factoryprintsetup.pas
来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 188 行
PAS
188 行
unit factoryprintsetup;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ppBands, ppCtrls, ppPrnabl, ppClass, ppCache, ppProd,
ppReport, ppDB, ppComm, ppRelatv, ppDBPipe, ppDBBDE, Db, ADODB;
type
Tfactoryreport = class(TForm)
RadioGroup1: TRadioGroup;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
ComboBox1: TComboBox;
Edit1: TEdit;
Edit2: TEdit;
Label2: TLabel;
Edit3: TEdit;
ppBDEPipeline1: TppBDEPipeline;
ppReport1: TppReport;
ppColumnHeaderBand1: TppColumnHeaderBand;
ppDetailBand1: TppDetailBand;
ppShape2: TppShape;
ppImage1: TppImage;
ppDBText2: TppDBText;
ppLabel1: TppLabel;
ppLabel2: TppLabel;
ppLabel3: TppLabel;
ppLabel4: TppLabel;
ppDBText5: TppDBText;
ppDBText4: TppDBText;
ppDBText3: TppDBText;
ppShape1: TppShape;
ppDBText6: TppDBText;
ppLabel5: TppLabel;
ppDBImage1: TppDBImage;
ppLabel12: TppLabel;
ppColumnFooterBand1: TppColumnFooterBand;
ppReport2: TppReport;
ppColumnHeaderBand3: TppColumnHeaderBand;
ppDetailBand3: TppDetailBand;
ppShape4: TppShape;
ppImage2: TppImage;
ppDBText14: TppDBText;
ppLabel6: TppLabel;
ppLabel7: TppLabel;
ppLabel8: TppLabel;
ppLabel9: TppLabel;
ppDBText15: TppDBText;
ppDBText16: TppDBText;
ppDBText17: TppDBText;
ppShape5: TppShape;
ppDBText18: TppDBText;
ppLabel10: TppLabel;
ppDBImage2: TppDBImage;
ppLabel11: TppLabel;
ppLabel13: TppLabel;
ppColumnFooterBand3: TppColumnFooterBand;
ppBDEPipeline2: TppBDEPipeline;
ppBDEPipeline2ppField1: TppField;
ppBDEPipeline2ppField2: TppField;
ppBDEPipeline2ppField3: TppField;
ppBDEPipeline2ppField4: TppField;
ppBDEPipeline2ppField5: TppField;
ppBDEPipeline2ppField6: TppField;
ppBDEPipeline2ppField7: TppField;
ppBDEPipeline2ppField8: TppField;
ppBDEPipeline2ppField9: TppField;
ppReport4: TppReport;
ppColumnHeaderBand2: TppColumnHeaderBand;
ppDetailBand2: TppDetailBand;
ppShape3: TppShape;
ppDBText7: TppDBText;
ppDBText8: TppDBText;
ppDBText9: TppDBText;
ppDBText10: TppDBText;
ppDBText11: TppDBText;
ppDBText12: TppDBText;
ppLabel14: TppLabel;
ppColumnFooterBand2: TppColumnFooterBand;
ppReport3: TppReport;
ppColumnHeaderBand4: TppColumnHeaderBand;
ppDetailBand4: TppDetailBand;
ppShape6: TppShape;
ppDBText19: TppDBText;
ppDBText20: TppDBText;
ppDBText21: TppDBText;
ppDBText22: TppDBText;
ppDBText23: TppDBText;
ppDBText24: TppDBText;
ppLabel15: TppLabel;
ppColumnFooterBand4: TppColumnFooterBand;
Qryfactory: TADOQuery;
Qryfactoryworkno: TStringField;
Qryfactorycardno: TStringField;
Qryfactoryname: TStringField;
Qryfactorydept: TStringField;
Qryfactoryprof: TStringField;
Qryfactoryindate: TDateTimeField;
Qryfactoryphoto: TStringField;
DSfactory: TDataSource;
Qrytemppic: TADOQuery;
DStemppic: TDataSource;
procedure RadioGroup1Click(Sender: TObject);
procedure ppReport1BeforePrint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
factoryreport: Tfactoryreport;
implementation
uses datamol,main;
{$R *.DFM}
procedure Tfactoryreport.RadioGroup1Click(Sender: TObject);
var qry:tadoquery;
begin
case radiogroup1.ItemIndex of
0:
begin
combobox1.visible:=false;
edit1.Visible:=false;
edit2.Visible:=false;
edit3.Visible:=false;
end;
1:
begin
combobox1.Visible:=true;
edit1.Visible:=false;
edit2.Visible:=false;
edit3.Visible:=false;
qry:=tadoquery.Create(self);
qry.Connection:=datamod.Database1;
qry.SQL.Text:='select * from pub05010 order by dept';
qry.Open;
combobox1.items.clear;
while not qry.Eof do
begin
combobox1.Items.Add(qry.fieldbyname('dept').asstring);
qry.Next;
end;
qry.Close;
end;
2:
begin
combobox1.Visible:=false;
edit1.Visible:=true;
edit2.Visible:=true;
edit3.Visible:=true;
end;
end;
end;
procedure Tfactoryreport.ppReport1BeforePrint(Sender: TObject);
begin
pplabel12.caption:=companyname1;
//初始化图片库
with datamod do
begin
query1.close;
query1.SQL.text:='Delete from temppic';
query1.execsql;
adopersonal.Close;
adopersonal.open;
adopersonal.first;
while not adopersonal.eof do
begin
qrytemppic.Insert;
qrytemppic.fieldbyname('workno').asstring:=adopersonal.fieldbyname('workno').asstring;
dbimage1.Picture.LoadFromFile(adopersonal.fieldbyname('photo').asstring);
qrytemppic.Post;
adopersonal.next;
end;
adopersonal.close;
query1.close;
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?