reportforprofmove.pas

来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 237 行

PAS
237
字号
unit reportforprofmove;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ppModule, raCodMod, ppBands, ppClass, ppCtrls, ppVar, ppPrnabl, ppCache,
  ppProd, ppReport, ppDB, ppComm, ppRelatv, ppDBPipe, Db, ADODB, StdCtrls,
  ExtCtrls, Mask;

type
  Treportforprof = class(TForm)
    Label1: TLabel;
    RadioGroup1: TRadioGroup;
    Button1: TButton;
    Button2: TButton;
    DataSource4: TDataSource;
    ADODataSet4: TADODataSet;
    ppDBPipeline4: TppDBPipeline;
    ppReport5: TppReport;
    MaskEdit1: TMaskEdit;
    MaskEdit2: TMaskEdit;
    Edit1: TEdit;
    ADODataSet4workno: TStringField;
    ADODataSet4cardno: TStringField;
    ADODataSet4name: TStringField;
    ADODataSet4sexname: TStringField;
    ADODataSet4dept: TStringField;
    ADODataSet4prof: TStringField;
    ADODataSet4Ldept: TStringField;
    ADODataSet4Lprof: TStringField;
    ADODataSet4usefuldate: TDateTimeField;
    ADODataSet4movekind: TStringField;
    ADODataSet4cdate: TDateTimeField;
    ADODataSet4operator: TStringField;
    ppReport1: TppReport;
    ppHeaderBand1: TppHeaderBand;
    ppLabel2: TppLabel;
    ppLabel3: TppLabel;
    ppLabel8: TppLabel;
    ppLabel9: TppLabel;
    ppLabel10: TppLabel;
    ppLabel12: TppLabel;
    ppLabel13: TppLabel;
    ppLabel14: TppLabel;
    ppLabel15: TppLabel;
    ppLabel16: TppLabel;
    ppLine4: TppLine;
    ppDetailBand1: TppDetailBand;
    ppDBText1: TppDBText;
    ppDBText2: TppDBText;
    ppDBText3: TppDBText;
    ppDBText5: TppDBText;
    ppDBText6: TppDBText;
    ppDBText7: TppDBText;
    ppDBText8: TppDBText;
    ppDBText9: TppDBText;
    ppFooterBand1: TppFooterBand;
    ppSummaryBand1: TppSummaryBand;
    ppDBCalc1: TppDBCalc;
    ppLabel18: TppLabel;
    ppLine5: TppLine;
    ppLabel4: TppLabel;
    ppSystemVariable1: TppSystemVariable;
    ppLabel5: TppLabel;
    ppLabel6: TppLabel;
    ppLabel7: TppLabel;
    ppSystemVariable2: TppSystemVariable;
    ppHeaderBand5: TppHeaderBand;
    ppLabel84: TppLabel;
    ppLabel85: TppLabel;
    ppLabel87: TppLabel;
    ppSystemVariable9: TppSystemVariable;
    ppLabel88: TppLabel;
    ppLabel89: TppLabel;
    ppLabel90: TppLabel;
    ppSystemVariable10: TppSystemVariable;
    ppLabel91: TppLabel;
    ppLabel92: TppLabel;
    ppLabel93: TppLabel;
    ppLabel94: TppLabel;
    ppLabel95: TppLabel;
    ppLabel96: TppLabel;
    ppLabel98: TppLabel;
    ppLabel99: TppLabel;
    ppLine6: TppLine;
    ppLabel1: TppLabel;
    ppLabel11: TppLabel;
    ppDetailBand5: TppDetailBand;
    ppDBText47: TppDBText;
    ppDBText48: TppDBText;
    ppDBText49: TppDBText;
    ppDBText50: TppDBText;
    ppDBText51: TppDBText;
    ppDBText52: TppDBText;
    ppDBText54: TppDBText;
    ppDBText55: TppDBText;
    ppDBText4: TppDBText;
    ppFooterBand5: TppFooterBand;
    ppSummaryBand5: TppSummaryBand;
    ppDBCalc9: TppDBCalc;
    ppLabel101: TppLabel;
    ppLine3: TppLine;
    ppGroup4: TppGroup;
    ppGroupHeaderBand4: TppGroupHeaderBand;
    ppDBText56: TppDBText;
    ppLine1: TppLine;
    ppGroupFooterBand4: TppGroupFooterBand;
    ppDBCalc8: TppDBCalc;
    ppLabel100: TppLabel;
    ppLine2: TppLine;
    raCodeModule3: TraCodeModule;
    ADODataSet4deptname: TStringField;
    procedure ppReport5BeforePrint(Sender: TObject);
    procedure ppReport5PreviewFormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ppReport5AfterPrint(Sender: TObject);
    procedure ppDBText56GetText(Sender: TObject; var Text: String);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  reportforprof: Treportforprof;

implementation
uses main,datamol;
{$R *.DFM}

procedure Treportforprof.ppReport5BeforePrint(Sender: TObject);
begin
  case radiogroup1.ItemIndex of
    0:
      begin
        pplabel84.Caption :=companyname1;
        pplabel89.caption:=pubworkname;
        pplabel1.Caption:='';
      end;
    1:
      begin
        pplabel84.Caption :=companyname1;
        pplabel89.caption:=pubworkname;
        pplabel1.Caption:=maskedit1.Text+'~~'+maskedit2.Text;
      end;
  end;
end;

procedure Treportforprof.ppReport5PreviewFormCreate(Sender: TObject);
begin
  tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
  //TppViewer(tppReport(Sender).PreviewForm.Viewer).ZoomSetting := zsWholePage;
end;

procedure Treportforprof.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  reportforprof:=nil;
  action:=cafree;
end;

procedure Treportforprof.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then    
   begin
     key:=#0;
     postmessage(handle,wm_keydown,vk_tab,0);
   end;
end;

procedure Treportforprof.Button1Click(Sender: TObject);
var fmat1:string;
begin
  if fmat='/' then
    fmat1:='    /  /  ';
  if fmat='-' then
    fmat1:='    -  -  ';
  case radiogroup1.ItemIndex of
    0:
      begin
        adodataset4.Close;
        adodataset4.CommandText:='select * from per21010 order by movekind,dept,workno ';
        adodataset4.Open;
        ppReport5.print;
      end;
    1:
      begin
        adodataset4.Close;
        if (maskedit1.Text<>fmat1 )and (maskedit2.text<>fmat1) then
        begin
          adodataset4.CommandText:='select * from per21010 where usefuldate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by movekind ,dept,workno';
          adodataset4.Open;
          ppReport5.print;
        end
        else
        begin
          Application.messagebox('列印部门升降调职日期范围不能为空!!!!!','系统提示',48);
          exit;
        end;
      end;
    2:
      begin
        adodataset4.Close;
        adodataset4.CommandText:='select * from per21010  order by  usefuldate,movekind ,dept,workno';
        adodataset4.Open;
        pplabel6.Caption:=pubworkname;
        pplabel2.Caption:=companyname1;
        ppreport1.Print;
      end;
  end;
end;
procedure Treportforprof.Button2Click(Sender: TObject);
begin
  close;
end;

procedure Treportforprof.ppReport5AfterPrint(Sender: TObject);
begin
  adodataset4.Close;
end;

procedure Treportforprof.ppDBText56GetText(Sender: TObject;
  var Text: String);
begin
    if Text='0'then
    Text:='提升'
  else if Text='1' then
    Text:='降职'
  else if Text='2' then
    Text:='部门调动'
end;
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?