📄 daybrushstat.pas
字号:
unit daybrushstat;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ComCtrls, ExtCtrls, Grids, DBGrids, Spin, Db, DBTables, Qrctrls,
QuickRpt, QRPrntr, Printers, QRExport, QRPrev, Dialogs, Messages;
type
TFormRiBao = class(TForm)
GroupBox1: TGroupBox;
YueBaoRep: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRGroup1: TQRGroup;
QRDBText1: TQRDBText;
DetailBand1: TQRBand;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
PageHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel1: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRDBText4: TQRDBText;
QRBand1: TQRBand;
QRDBText5: TQRDBText;
PageFooterBand1: TQRBand;
QRSysData1: TQRSysData;
QRLabel6: TQRLabel;
SummaryBand1: TQRBand;
QRExpr4: TQRExpr;
QRLabel7: TQRLabel;
ButtonCreat: TButton;
ButtonClose: TButton;
Label4: TLabel;
DateTimePicker1: TDateTimePicker;
procedure ButtonCreatClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ButtonCloseClick(Sender: TObject);
procedure YueBaoRepPreview(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormRiBao: TFormRiBao;
date,day:tdatetime;
implementation
uses huaxia, YueBaoPreview;
{$R *.DFM}
procedure TFormRiBao.ButtonCreatClick(Sender: TObject);
Var Pointx,Pointy:Integer;
begin
day:=datetimepicker1.datetime;
huaxiadata.QueryRiBao.active:=false;
huaxiadata.queryRiBaoHuiZong.active:=false;
with huaxiadata.QueryRiBao do
begin
parambyname('date').asdatetime:=day;
end;
with huaxiadata.QueryRiBaoHuiZong do
begin
parambyname('date').asdatetime:=day;
end;
huaxiadata.queryRiBao.Prepare;
huaxiadata.queryRiBaoHuiZong.prepare;
huaxiadata.queryRiBao.active:=true;
huaxiadata.queryRiBaoHuiZong.active:=true;
qrlabel2.caption:='刷卡情况统计表';
YueBaoRep.Page.Orientation:=Printer.Orientation;
YueBaoRep.Page.PaperSize:=Custom;
YueBaoRep.Units:=Inches;
Pointx:=GetDeviceCaps(Printer.Handle,LOGPIXELSX);
Pointy:=GetDeviceCaps(Printer.Handle,LOGPIXELSY);
YueBaoRep.Page.Width:=Printer.PageWidth/Pointx;
YueBaoRep.Page.Length:=Printer.Pageheight/Pointy;
YueBaoRep.preview;
end;
procedure TFormRiBao.FormActivate(Sender: TObject);
begin
datetimepicker1.datetime:=now;
end;
procedure TFormRiBao.FormClose(Sender: TObject; var Action: TCloseAction);
begin
huaxiadata.QueryRiBao.active:=false;
huaxiadata.QueryRiBaoHuiZong.active:=false;
end;
procedure TFormRiBao.ButtonCloseClick(Sender: TObject);
begin
YueBaoRep.QRPrinter:=Nil;
Close;
end;
procedure TFormRiBao.YueBaoRepPreview(Sender: TObject);
begin
with TFormYueBaoPreview.Create(Application) do
begin
QRPreviewYueBao.QRPrinter:=TQRPrinter(Sender);
CurRep:=YueBaoRep;
Show;
end;
end;
procedure TFormRiBao.FormKeyPress(Sender: TObject; var Key: Char);
begin
If key=#13 then { 判断是按执行键}
Begin
key:=#0;
perform(WM_NEXTDLGCTL,0,0);
End;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -