⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uprint.pas

📁 一个很好的员工档案管理系统源码 有无限制树
💻 PAS
字号:
unit uPrint;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, FR_Class, FR_Desgn, DB, ADODB, FR_DSet,
  FR_DBSet, uModalbase;

type
  TfrmPrint = class(TfrmModalBase)
    cbInfo: TCheckBox;
    cbEx: TCheckBox;
    cbTrain: TCheckBox;
    Label1: TLabel;
    btnPrint: TBitBtn;
    btnClose: TBitBtn;
    fdsSinfo: TfrDBDataSet;
    fdsExper: TfrDBDataSet;
    fdsTrain: TfrDBDataSet;
    frPer: TfrReport;
    procedure btnPrintClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    FIds: string;
    procedure DataInit;
  public
    { Public declarations }
    constructor Create(AOwner: TComponent; AIds: string); reintroduce;
  end;

var
  frmPrint: TfrmPrint;

implementation

uses udata, ustainfo, uglobal;

{$R *.dfm}

constructor TfrmPrint.Create(AOwner: TComponent; AIds: string);
begin
  inherited Create(AOwner);
  FIds := AIds;
end;

procedure TfrmPrint.DataInit;
begin
  with DM do
  begin

    OpenStaf(FIds);
    aqStaf.FieldByName('depid').OnGetText := GetDeptText;
    aqStaf.FieldByName('sorts').OnGetText := GetOtherText;
    aqStaf.FieldByName('duty').OnGetText := GetOtherText;
    aqStaf.FieldByName('folk').OnGetText := GetOtherText;
    aqStaf.FieldByName('level').OnGetText := GetOtherText;
    aqStaf.FieldByName('special').OnGetText := GetOtherText;
    OpenExperf;
    

    OpenTrainf;
  end;
end;

procedure TfrmPrint.FormShow(Sender: TObject);
begin
  DataInit;
end;

procedure TfrmPrint.btnPrintClick(Sender: TObject);
begin
  if not (cbInfo.Checked or cbEx.Checked  or cbTrain.Checked) then
  begin
    MessageBox(Handle, '请选择要打印的内容!', '提示', mb_IconInformation + mb_Ok);
    cbInfo.Checked := True;
  end
  else
  begin
    DataInit;
    frPer.LoadFromFile(MyApp.Path + 'frPer.frf');

    TFrBandView(frPer.FindObject('bvSd')).Visible := cbInfo.Checked;
    TFrBandView(frPer.FindObject('bvEh')).Visible := cbEx.Checked;
    TFrBandView(frPer.FindObject('bvEd')).Visible := cbEx.Checked;

    
    TFrBandView(frPer.FindObject('bvTh')).Visible := cbTrain.Checked;
    TFrBandView(frPer.FindObject('bvTh')).Visible := cbTrain.Checked;

    frPer.ShowReport;
    Log.Write('进行打印员工信息操作,所取员工ID号为' + FIds);
  end;
end;

end.

⌨️ 快捷键说明

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