📄 brushlist.pas
字号:
unit brushlist;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ComCtrls, ExtCtrls, Grids, DBGrids, Spin, Db, DBTables, Qrctrls,
QuickRpt, DBCtrls, QRPrntr, Printers, Messages;
type
TFormMingXi = class(TForm)
GroupBox1: TGroupBox;
Label4: TLabel;
ComboBoxYear: TComboBox;
Label6: TLabel;
ComboBoxMonth: TComboBox;
MingXiRep: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRGroup1: TQRGroup;
QRDBText1: TQRDBText;
DetailBand1: TQRBand;
QRDBText3: TQRDBText;
PageHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel1: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRDBText4: TQRDBText;
QRBand1: TQRBand;
QRDBText5: TQRDBText;
Label1: TLabel;
DBLookupComboBoxComp: TDBLookupComboBox;
ButtonCreat: TButton;
ButtonClose: TButton;
QRLabel6: TQRLabel;
procedure ButtonCreatClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ButtonCloseClick(Sender: TObject);
procedure MingXiRepPreview(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMingXi: TFormMingXi;
year,month,yea,mon,company:string;
implementation
uses huaxia, YueBaoPreview;
{$R *.DFM}
procedure TFormMingXi.ButtonCreatClick(Sender: TObject);
Var Pointx,Pointy:Integer;
Begin
year:=comboboxYear.text;
month:=comboboxMonth.Text;
HuaxiaData.QueryMingXi.Active:=False;
HuaxiaData.QueryMingXiHuiZong.Active:=False;
With huaxiadata.QueryMingXi Do
Begin
Parambyname('yea').AsString:=year;
Parambyname('mon').AsString:=month;
Parambyname('company').AsString:=HuaXiaData.CompTable.FieldByName('Comp_code').AsString;
End;
With Huaxiadata.QueryMingXiHuiZong Do
Begin
ParambyName('yea').Asstring:=year;
ParambyName('mon').Asstring:=month;
ParambyName('company').Asstring:=HuaXiaData.CompTable.FieldByName('comp_code').AsString;
End;
HuaxiaData.QueryMingXi.Prepare;
HuaxiaData.QueryMingXiHuiZong.Prepare;
HuaxiaData.QueryMingXi.Active:=True;
Huaxiadata.queryMingXiHuiZong.Active:=True;
qrlabel2.caption:=year+'年'+month+'月刷卡情况明细表';
MingXiRep.Page.Orientation:=Printer.Orientation;
MingXiRep.Page.PaperSize:=Custom;
MingXiRep.Units:=Inches;
Pointx:=GetDeviceCaps(Printer.Handle,LOGPIXELSX);
Pointy:=GetDeviceCaps(Printer.Handle,LOGPIXELSY);
MingXiRep.Page.Width:=Printer.PageWidth/Pointx;
MingXiRep.Page.Length:=Printer.Pageheight/Pointy;
MingXiRep.Preview;
end;
procedure TFormMingXi.FormActivate(Sender: TObject);
begin
DatetimeToString(year,'yyyy',now);
DatetimeToString(month,'mm',now);
ComboboxYear.Text:=year;
ComboboxMonth.Text:=month;
end;
procedure TFormMingXi.FormClose(Sender: TObject; var Action: TCloseAction);
begin
HuaxiaData.CompTable.Active:=False;
HuaxiaData.QueryMingXi.Active:=False;
HuaxiaData.QueryMingXiHuiZong.Active:=False;
end;
procedure TFormMingXi.ButtonCloseClick(Sender: TObject);
begin
MingXiRep.QRPrinter:=Nil;
Close;
end;
procedure TFormMingXi.MingXiRepPreview(Sender: TObject);
begin
with TFormYueBaoPreview.Create(Application) do
begin
QRPreviewYueBao.QRPrinter:=TQRPrinter(Sender);
CurRep:=MingXiRep;
Show;
end;
end;
procedure TFormMingXi.FormShow(Sender: TObject);
begin
Huaxiadata.CompTable.active:=True;
end;
procedure TFormMingXi.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 + -