📄 hygl_report_dbmc.pas
字号:
unit HYGL_report_dbmc;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls, StdCtrls, Buttons, jpeg;
type
TFrmHYGL_Report_dbmc = class(TForm)
QuickRep1: TQuickRep;
PageHeaderBand1: TQRBand;
Lab_BT: TQRLabel;
DetailBand1: TQRBand;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
Lab_XH: TQRLabel;
QRDBText1: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
ChildBand1: TQRChildBand;
QRShape1: TQRShape;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
PageFooterBand1: TQRBand;
QRShape25: TQRShape;
Panel1: TPanel;
Label16: TLabel;
Image1: TImage;
Label1: TLabel;
btn_preview: TSpeedButton;
btn_print: TSpeedButton;
Btn_exit: TSpeedButton;
Edt_BT: TEdit;
Label2: TLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure FormShow(Sender: TObject);
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btn_previewClick(Sender: TObject);
procedure btn_printClick(Sender: TObject);
procedure Btn_exitClick(Sender: TObject);
procedure QRDBText6Print(sender: TObject; var Value: String);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmHYGL_Report_dbmc: TFrmHYGL_Report_dbmc;
implementation
uses HYGL_DModule, HYGL_main;
{$R *.dfm}
procedure TFrmHYGL_Report_dbmc.FormShow(Sender: TObject);
var
i,n:integer;
begin
Image1.Picture:=FRMHYGL_Main.IMG_LOGO.Picture;
with dmd do begin
if not Tbl_ZGDB.active then Tbl_ZGDB.open;
end;
with dmd.Tbl_ZGDB do begin
last;
n:=recordcount;
if (n mod 23)<>0 then begin //用空记录补足整页记录
for i:=1 to (23-(n mod 23)) do begin
append;
FieldValues['hyzh'] :='zzzz';
post;
end;
close;
open;
end;
end;
//QuickRep1.DataSet:=dmd.Tbl_zgdb;
end;
procedure TFrmHYGL_Report_dbmc.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
lab_bt.Caption:=edt_bt.Text;
lab_xh.Caption:='0';
end;
//控制序号
procedure TFrmHYGL_Report_dbmc.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
try
lab_xh.Caption:=inttostr(strtoint(lab_xh.Caption)+1);
except
end;
end;
procedure TFrmHYGL_Report_dbmc.FormClose(Sender: TObject;
var Action: TCloseAction);
var
s1:string;
begin
//删除打印时添加的空记录
S1:='delete from 职工代表 where trim(hyzh)="zzzz"';
with dmd.qry_temp do begin
close;
SQL.CLEAR;
sql.add(s1);
try
open;
except
execsql;
end;
end; {with}
//强制更新
dmd.tbl_zgdb.close;
dmd.tbl_zgdb.open;
end;
procedure TFrmHYGL_Report_dbmc.btn_previewClick(Sender: TObject);
begin
with dmd.qry_temp do begin
close;
SQL.CLEAR;
sql.add('select * from 职工代表' );
try
open;
except
execsql;
end;
end; {with}
QuickRep1.Preview;
end;
procedure TFrmHYGL_Report_dbmc.btn_printClick(Sender: TObject);
begin
with dmd.qry_temp do begin
close;
SQL.CLEAR;
sql.add('select * from 职工代表' );
try
open;
except
execsql;
end;
end; {with}
QuickRep1.Print;
end;
procedure TFrmHYGL_Report_dbmc.Btn_exitClick(Sender: TObject);
begin
close;
end;
procedure TFrmHYGL_Report_dbmc.QRDBText6Print(sender: TObject;
var Value: String);
begin
if value='0' then begin
value:='';
lab_xh.Caption:=''
end;
end;
procedure TFrmHYGL_Report_dbmc.FormCreate(Sender: TObject);
begin
height:=290;
width:=450;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -