formsexname.pas
来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 86 行
PAS
86 行
unit formsexname;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, TeEngine, Series, TeeProcs,
Chart, DBChart, QrTee, ADODB, Db;
type
Tsexname = class(TQuickRep)
ADOsexname: TADODataSet;
ADOQuery1: TADOQuery;
QRShape1: TQRShape;
QRChart1: TQRChart;
QRDBChart1: TQRDBChart;
QRShape2: TQRShape;
QRShape3: TQRShape;
Series1: TPieSeries;
QRChart2: TQRChart;
QRDBChart2: TQRDBChart;
PieSeries1: TPieSeries;
QRChart5: TQRChart;
QRDBChart5: TQRDBChart;
Series5: TBarSeries;
ADODataSet2: TADODataSet;
TitleBand1: TQRBand;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRSysData1: TQRSysData;
QRLabel9: TQRLabel;
QRSysData2: TQRSysData;
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRepAfterPrint(Sender: TObject);
private
public
end;
var
sexname: Tsexname;
implementation
uses main,personalreport,datamol;
{$R *.DFM}
procedure Tsexname.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
if (formpersonalreport.MaskEdit1.text=' / / ') or (formpersonalreport.MaskEdit2.text=' / / ') then
begin
Application.MessageBox('日期输入不完整!','Error',mb_ok+mb_iconerror);
exit;
end;
adosexname.close;
adodataset2.close;
adosexname.CommandText:='select sexname,count(workno) from per24010 where leave=0 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') group by sexname';
//adodataset2.CommandText:='select ''20岁以下'' as name1,count(*) as num1 from per24010 where leave=0 and age<=20 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') union '+
//'select ''20-25岁'' as name1,count(*) from per24010 where age>20 and age<=25 and leave=0 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') union '+
//'select ''26-30岁'' as name1,count(*) from per24010 where age>=26 and age<=30 and leave=0 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') union '+
//'select ''30-40岁'' as name1,count(*) from per24010 where age>30 and age<=40 and leave=0 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') union '+
//'select ''40岁以上'' as name1,count(*) from per24010 where age>40 and leave=0 and indate between convert(datetime,'''+formpersonalreport.maskedit1.Text+''') and convert(datetime,'''+formpersonalreport.maskedit2.Text+''') ';
adodataset2.open;
adosexname.Open;
adoquery1.Open;
QRLabel4.caption:=companyname1;
qrlabel7.caption:=pubworkname;
end;
procedure Tsexname.QuickRepAfterPrint(Sender: TObject);
begin
adosexname.close;
adodataset2.close;
adoquery1.Close;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?