📄 sy_yjhz_rpt.pas
字号:
{*******************************************************}
{ }
{ 结算汇总单打印 }
{ }
{ 中软金马公司版权所有。2002.12前 }
{ }
{ 编制:中软金马项目开发组 }
{ }
{ }
{*******************************************************}
(*
本模块在省级集邮票管理、省级市场购入票管理、省级集邮品管理、省级零枚票管理、
地市集邮票管理、地市集邮品管理、地市市场购入票管理 七个模块调用
*)
unit SY_YJHZ_RPT;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, DBTables, RxQuery,
SqlStrings;
type
TQuickRep_YJHZ = class(TQuickRep)
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
PageHeaderBand1: TQRBand;
SqlStrings1: TSqlStrings;
Qry_Print: TRxQuery;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRRichText1: TQRRichText;
QRRichText2: TQRRichText;
QRRichText3: TQRRichText;
QRRichText4: TQRRichText;
QRRichText5: TQRRichText;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRLabel7: TQRLabel;
QRShape15: TQRShape;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRSysData1: TQRSysData;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRShape16: TQRShape;
QRLabel13: TQRLabel;
QRShape17: TQRShape;
QRRichText6: TQRRichText;
SqlStrings2: TSqlStrings;
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRepStartPage(Sender: TCustomQuickRep);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
private
public
LineCount:Integer;
sum_jsje,sum_xjje:Double;
end;
var
QuickRep_YJHZ: TQuickRep_YJHZ;
implementation
uses SJ_JSHZD;
{$R *.DFM}
procedure TQuickRep_YJHZ.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
begin
Inc(LineCount);
if not Qry_Print.eof then
begin
QRShape12.Enabled:=True;
QRShape13.Enabled:=True;
QRRichText1.Lines.Text:=Qry_Print.fieldbyName('dwjc').AsString;
QRRichText2.Lines.Text:=Qry_Print.FieldbyName('dh').AsString;
QRRichText3.Lines.Text:=Qry_Print.FieldByName('kdrq').AsString;
QRRichText4.Lines.Text:=FormatFloat('#,##0.00',Qry_Print.FieldByName('xjje').AsFloat);
QRRichText5.Lines.Text:=FormatFloat('#,##0.00',Qry_Print.FieldByName('jsje').AsFloat);
//入库单中不存在结算状态信息,因此显示为‘-----’
case frm_JSHZD.RGr_Base.ItemIndex of
0: QRRichText6.Lines.Text:=Qry_Print.FieldByName('jszt').AsString;
1: QRRichText6.Lines.Text:=' --------';
end;
sum_jsje:=sum_jsje+ Qry_Print.FieldByName('jsje').AsFloat;
sum_xjje:=sum_xjje+ Qry_Print.FieldByName('xjje').AsFloat;
if Qry_Print.FieldByName('dh').AsString='' then
begin
QRRichText2.Lines.Text :=' 合 计 ';
QRRichText6.Lines.Text :=' --------';
QRRichText1.Lines.Text:='';
QRShape12.Enabled:=False;
QRShape13.Enabled:=False;
end;
end
else begin
if LineCount=28 then
begin
QRShape12.Enabled:=False;
QRShape13.Enabled:=False;
QRRichText1.Lines.Text:='';
QRRichText2.Lines.Text:=' 总 计';
QRRichText3.Lines.Text:='';
QRRichText4.Lines.Text:=FormatFloat('#,##0.00',sum_xjje*0.5);
QRRichText5.Lines.Text:=FormatFloat('#,##0.00',sum_jsje*0.5);
QRRichText6.Lines.Text :=' --------';
end
else begin
QRShape12.Enabled:=True;
QRShape13.Enabled:=True;
QRRichText1.Lines.Text:='';
QRRichText2.Lines.Text:='';
QRRichText3.Lines.Text:='';
QRRichText4.Lines.Text:='';
QRRichText5.Lines.Text:='';
QRRichText6.Lines.Text:='';
end;
end;
MoreData:=not Qry_Print.Eof;
if not Qry_Print.Eof then
Qry_Print.next;
if LineCount<=28 then
MoreData:=True;
end;
procedure TQuickRep_YJHZ.QuickRepStartPage(Sender: TCustomQuickRep);
begin
LineCount:=0;
end;
procedure TQuickRep_YJHZ.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Qry_Print.First;
LineCount:=0;
sum_jsje:=0;
sum_xjje:=0;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -