📄 lmp_rkfh_print.pas
字号:
{*******************************************************}
{ }
{ 零枚票入库单打印 }
{ }
{ 中软金马公司版权所有。2002.12前 }
{ }
{ 编制:中软金马项目开发组 }
{ }
{ }
{*******************************************************}
(*
本模块在省级库房管理模块 零枚票部分的 零枚票入库审核 模块中调用。
*)
unit LMP_RKFH_Print;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Dialogs, Db, DBTables;
type
TFrm_LMP_RKFH_Print = class(TQuickRep)
PageHeaderBand1: TQRBand;
PageFooterBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
SummaryBand1: TQRBand;
QRLabel1: TQRLabel;
QRShape1: TQRShape;
QRLabel6: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel24: TQRLabel;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRLabel25: TQRLabel;
QRLabel4: TQRLabel;
QRLabel13: TQRLabel;
DetailBand1: TQRBand;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRRichText2: TQRRichText;
QRRichText3: TQRRichText;
QRRichText4: TQRRichText;
QRRichText5: TQRRichText;
QRRichText6: TQRRichText;
QRRichText7: TQRRichText;
Qry_ckdayin: TQuery;
ChildBand1: TQRChildBand;
Qry_bz: TQuery;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
QRShape2: TQRShape;
QRShape5: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRLabel23: TQRLabel;
QRLabel3: TQRLabel;
QRLabel5: TQRLabel;
QRRichText8: TQRRichText;
QRRichText9: TQRRichText;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRShape26: TQRShape;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRRichText1: TQRRichText;
QRRichText11: TQRRichText;
QRLabel2: TQRLabel;
QRLabel7: TQRLabel;
QRRichText10: TQRRichText;
QRShape27: TQRShape;
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
function GetTextHeight(FontName: string; FontSize: Integer): integer;
private
public
nheight: integer;
sumzj: double;
sumjsj: double;
end;
var
Frm_LMP_RKFH_Print: TFrm_LMP_RKFH_Print;
implementation
{$R *.DFM}
uses Pub;
procedure TFrm_LMP_RKFH_Print.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
var
vlp_i_max, i, j: integer;
zjje, jsje: double;
begin
QRRichText2.Lines.Text := Qry_ckdayin.fieldbyname('zh').asstring;
QRRichText3.Lines.Text := Qry_ckdayin.fieldbyname('tmc').asstring;
QRRichText4.Lines.Text := Qry_ckdayin.fieldbyname('dw').asstring;
QRRichText5.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('xj').AsFloat);
QRRichText6.Lines.Text := SetPntFmtstr(1, Qry_ckdayin.fieldbyname('sl').AsFloat);
QRRichText7.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('zjje').AsFloat);
zjje := Qry_ckdayin.fieldbyname('zjje').asfloat;
QRRichText8.Lines.Text := Qry_ckdayin.fieldbyname('zk').asstring;
QRRichText10.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('jsj').AsFloat);
QRRichText9.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('jsje').AsFloat);
jsje := Qry_ckdayin.fieldbyname('jsje').asfloat;
if not (Qry_ckdayin.eof) then
begin sumzj := sumzj + zjje;
QRRichText1.Lines.Text := SetPntFmtstr(0, sumzj);
end;
if not (Qry_ckdayin.eof) then
begin sumjsj := sumjsj + jsje;
QRRichText11.Lines.Text := SetPntFmtstr(0, sumjsj);
end;
for I := 0 to DetailBand1.ControlCount - 1 do
begin
if Not (DetailBand1.Controls[I] is TQRRichText) then
Continue;
if TQRRichText(DetailBand1.Controls[I]).Lines.Count <= 1 then
Continue;
for J := TQRRichText(DetailBand1.Controls[I]).Lines.Count - 1 downto 0 do
begin
if comparetext(Trim(TQRRichText(DetailBand1.Controls[I]).Lines[J]), '') <> 0 then
break;
TQRRichText(DetailBand1.Controls[I]).Lines.Delete(J);
end;
end;
vlp_i_max := 1;
for I := 0 to DetailBand1.ControlCount - 1 do
begin
if Not (DetailBand1.Controls[I] is TQRRichText) then
Continue;
if TQRRichText(DetailBand1.Controls[I]).Lines.Count > vlp_i_max then
vlp_i_max := TQRRichText(DetailBand1.Controls[I]).Lines.Count;
end;
DetailBand1.Height := vlp_i_max * nheight + 4;
for I := 0 to DetailBand1.ControlCount - 1 do
begin
if DetailBand1.Controls[I] is TQRShape then
TQRShape(DetailBand1.Controls[I]).Height := DetailBand1.Height;
if DetailBand1.Controls[I] is TQRRichText then
TQRRichText(DetailBand1.Controls[I]).Height := DetailBand1.Height;
end;
MoreData := not Qry_ckdayin.Eof;
if MoreData then
Qry_ckdayin.Next;
end;
function TFrm_LMP_RKFH_Print.GetTextHeight(FontName: string; FontSize: Integer): integer;
begin
Font.Name := FontName;
Font.Size := FontSize;
Result := Canvas.TextHeight('中软金马公司') + 4;
end;
procedure TFrm_LMP_RKFH_Print.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Qry_ckdayin.First;
sumzj := 0;
sumjsj := 0;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -