📄 u_qreport.pas
字号:
unit U_QReport;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, QuickRpt, QRCtrls;
type
TF_QReport = class(TQuickRep)
QRBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRShape1: TQRShape;
QRLabel7: TQRLabel;
QRShape2: TQRShape;
QRBand2: TQRBand;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRBand5: TQRBand;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRLabel15: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRBand3: TQRBand;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRLabel22: TQRLabel;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel5: TQRLabel;
QRLabel16: TQRLabel;
QRLabel23: TQRLabel;
QRShape15: TQRShape;
QRShape21: TQRShape;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRShape22: TQRShape;
QRShape24: TQRShape;
QRLabel6: TQRLabel;
QRLabel30: TQRLabel;
QRShape26: TQRShape;
QRShape23: TQRShape;
procedure QRLabel15Print(sender: TObject; var Value: String);
procedure QRLabel17Print(sender: TObject; var Value: String);
procedure QRLabel18Print(sender: TObject; var Value: String);
procedure QRLabel19Print(sender: TObject; var Value: String);
procedure QRLabel20Print(sender: TObject; var Value: String);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QRLabel16Print(sender: TObject; var Value: String);
private
curr_record:integer;
//reccount:integer;
public
zfs_Total:double;
zks_Total:double;
ws_Total:double;
zhks_Total:double;
end;
var
F_QReport: TF_QReport;
implementation
uses U_jfFR;
{$R *.DFM}
procedure TF_QReport.QRLabel15Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].caption;
end;
procedure TF_QReport.QRLabel17Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].SubItems[2];
end;
procedure TF_QReport.QRLabel18Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].SubItems[3];
end;
procedure TF_QReport.QRLabel19Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].SubItems[4];
end;
procedure TF_QReport.QRLabel20Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].SubItems[5];
end;
procedure TF_QReport.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
curr_record:=0; // 2004/08/13 add
zfs_Total:=0; // 2004/08/13 add
zks_Total:=0; // 2004/08/13 add
ws_Total:=0; // 2004/08/13 add
zhks_Total:=0; // 2004/08/13 add
// reccount:=F_jfFR.LV1.Items.Count-1; //2004/08/13 modify
end;
procedure TF_QReport.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
begin
{if curr_record<=reccount then
begin
MoreData:=true ;
F_jfFR.zfs_Total:=F_jfFR.zfs_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[2]);
F_jfFR.zks_Total:=F_jfFR.zks_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[3]);
F_jfFR.ws_Total:=F_jfFR.ws_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[4]);
F_jfFR.zhks_Total:=F_jfFR.zhks_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[5]);
end
else
begin
MoreData:=false;
QRLabel23.Caption := FloatToStr(F_jfFR.zfs_Total);
QRLabel24.Caption := FloatToStr(F_jfFR.zks_Total);
QRLabel25.Caption := FloatToStr(F_jfFR.ws_Total);
QRLabel26.Caption := FloatToStr(F_jfFR.zhks_Total);
end; } //2004/08/13 modify
MoreData:=true ;
if curr_record>F_jffr.LV1.Items.Count-1 then
begin
MoreData:=false;
QRLabel23.Caption := FloatToStr(zfs_Total);
QRLabel24.Caption := FloatToStr(zks_Total);
QRLabel25.Caption := FloatToStr(ws_Total);
QRLabel26.Caption := FloatToStr(zhks_Total);
end
else
begin
zfs_Total:=zfs_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[2]);
zks_Total:=zks_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[3]);
ws_Total:=ws_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[4]);
zhks_Total:=zhks_Total + StrToFloat(F_jfFR.LV1.Items[curr_record].SubItems[5]);
end;
end;
procedure TF_QReport.QRLabel16Print(sender: TObject; var Value: String);
begin
Value:=F_jfFR.LV1.Items[curr_record].SubItems[0];
curr_record:=curr_record+1;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -