?? sj_fhddy0.pas
字號:
{*******************************************************}
{ }
{ 發貨通知單打印 }
{ }
{ 中軟金馬公司版權所有。2002.12前 }
{ }
{ 編制:中軟金馬項目開發組 }
{ }
{ }
{*******************************************************}
(*
本模塊在省級集郵票管理、省級市場購入票管理、省級集郵品管理、省級零枚票管理、
地市集郵票管理、地市集郵品管理、地市市場購入票管理 七個模塊調用
修改記錄:
1。將發貨單單調整為常用打印紙大小——大小紙打印行數 by jhshao 2003.05.07
*)
unit SJ_FHDDY0;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Dialogs, Db, DBTables;
const
QR_DetailLines_XZ = 6;
QR_DetailLines_DZ = 24;//26
type
TFrmK_JYFHDDY0 = class(TQuickRep)
PageHeaderBand1: TQRBand;
PageFooterBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel6: TQRLabel;
QRLabel8: 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;
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;
Qry_bz: TQuery;
QRLabel11: TQRLabel;
QRShape2: TQRShape;
QRShape5: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRLabel23: TQRLabel;
QRLabel3: TQRLabel;
QRLabel5: TQRLabel;
QRLabel7: TQRLabel;
QRRichText8: TQRRichText;
QRRichText9: TQRRichText;
QRRichText10: TQRRichText;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRLabel12: TQRLabel;
QRSysData1: TQRSysData;
QRShape1: TQRShape;
QRShape29: TQRShape;
QRShape33: TQRShape;
QRShape34: TQRShape;
QRLabel13: TQRLabel;
QRShape18: TQRShape;
QRShape24: TQRShape;
QRShape19: TQRShape;
QRShape25: TQRShape;
QRShape20: TQRShape;
QRRichText1: TQRRichText;
QRShape21: TQRShape;
QRShape26: TQRShape;
QRShape22: TQRShape;
QRRichText11: TQRRichText;
QRShape23: TQRShape;
QRShape32: TQRShape;
QRLabel14: TQRLabel;
QRLabel27: TQRLabel;
QRLabel26: TQRLabel;
QRLabel15: TQRLabel;
QRShape35: TQRShape;
QRShape36: TQRShape;
QRShape37: TQRShape;
QRShape38: TQRShape;
QRLabel2: TQRLabel;
QRShape39: TQRShape;
QRShape40: TQRShape;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRShape30: TQRShape;
QRShape31: TQRShape;
QRShape41: TQRShape;
QRShape42: TQRShape;
QRShape43: TQRShape;
QRShape44: TQRShape;
QRShape45: TQRShape;
QRShape46: TQRShape;
QRShape47: TQRShape;
QRShape48: TQRShape;
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRepStartPage(Sender: TCustomQuickRep);
private
public
nheight: integer;
sumzj: double;
sumjsj: double;
TotalPageCount: Integer;
Tao_Print_Flag: Boolean;
DetailLines: Integer;
DataCount: Integer;
SmallFlag: Boolean;
end;
var
FrmK_JYFHDDY0: TFrmK_JYFHDDY0;
implementation
uses SJ_RichEdit;
{$R *.DFM}
procedure TFrmK_JYFHDDY0.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
var
vlp_i_max, i, j: integer;
zjje, jsje: double;
begin
if SmallFlag then
begin
if DetailLines = QR_DetailLines_XZ then
DetailLines := 1;
if DetailLines <= QR_DetailLines_XZ - 1 then
begin
Inc(DetailLines);
MoreData := True;
end;
end
else
begin
if DetailLines = QR_DetailLines_DZ then
DetailLines := 1;
if DetailLines <= QR_DetailLines_DZ - 1 then
begin
Inc(DetailLines);
MoreData := True;
end;
end;
if not Qry_ckdayin.Eof then
begin
Frm_RichEdit.RichEdit1.Width := QRRichText3.Width;
Frm_richEdit.RichEdit1.Lines.Clear;
Frm_richEdit.RichEdit1.Lines.Text := Qry_ckdayin.FieldByName('tmc').AsString;
QRRichText3.Lines.Text := Frm_richEdit.RichEdit1.Lines.Text;
if QRRichText3.Lines.Count > 1 then
begin
QRRichText3.Font.Size := 9;
if QRRichText3.Lines.Count > 1 then
QRRichText3.Top := -2
else
QRRichText3.Top := 1;
end
else
begin
QRRichText3.Font.Size := 11;
QRRichText3.Top := 1;
end;
Frm_RichEdit.RichEdit1.Width := QRRichText2.Width;
Frm_richEdit.RichEdit1.Lines.Clear;
Frm_richEdit.RichEdit1.Lines.Text := Qry_ckdayin.FieldByName('zh').AsString;
// Frm_richEdit.RichEdit1.Width :=
QRRichText2.Lines.Text := Frm_richEdit.RichEdit1.Lines.Text;
// if QRRichText2.Lines.Count > 1 then
if length(QRRichText2.Lines[0]) > 24 then
begin
QRRichText2.Font.Size := 9;
if QRRichText2.Lines.Count > 1 then
QRRichText2.Top := 1
else
QRRichText2.Top := -2;
end
else
begin
QRRichText2.Font.Size := 11;
QRRichText2.Top := 1;
end;
QRRichText4.Lines.Text := Qry_ckdayin.fieldbyname('dw').asstring;
QRRichText5.Lines.Text := FormatFloat('#,##', Qry_ckdayin.fieldbyname('sl').asFloat);
QRRichText6.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('xj').asFloat);
QRRichText7.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('zjje').asFloat);
zjje := Qry_ckdayin.fieldbyname('zjje').asfloat;
QRRichText8.Lines.Text := Qry_ckdayin.fieldbyname('zk').asstring;
QRRichText9.Lines.Text := FormatFloat('#,##0.00', Qry_ckdayin.fieldbyname('jsje').asFloat);
QRRichText10.Lines.Text := '';
if Qry_ckdayin.fieldbyname('fxrq').asstring <> '' then
QRRichText10.Lines.Text := FormatDateTime('yyyy"/"mm"/"dd', StrToDateTime(Qry_ckdayin.fieldbyname('fxrq').asstring));
jsje := Qry_ckdayin.fieldbyname('jsje').asfloat;
sumzj := sumzj + zjje;
QRRichText1.Lines.Text := FormatFloat('#,##0.00', sumzj);
sumjsj := sumjsj + jsje;
QRRichText11.Lines.Text := FormatFloat('#,##0.00', sumjsj);
DetailBand1.Height := 30;
end;
if MoreData and (Qry_ckdayin.Eof) then
begin
QRRichText3.Lines.Text := '';
QRRichText4.Lines.Text := '';
QRRichText5.Lines.Text := '';
QRRichText6.Lines.Text := '';
QRRichText7.Lines.Text := '';
QRRichText9.Lines.Text := '';
QRRichText8.Lines.Text := '';
QRRichText10.Lines.Text := '';
QRRichText2.Lines.text := '';
if SmallFlag then
begin
if DetailLines = QR_DetailLines_XZ then
MoreData := False;
end
else
begin
if DetailLines = QR_DetailLines_DZ then
MoreData := False;
end;
end;
if (not Qry_ckdayin.Eof) then
begin
MoreData := not Qry_ckdayin.eof;
Qry_ckdayin.Next;
end;
end;
procedure TFrmK_JYFHDDY0.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
sumzj := 0;
sumjsj := 0;
DetailLines := 0;
Qry_ckdayin.First;
end;
procedure TFrmK_JYFHDDY0.QuickRepStartPage(Sender: TCustomQuickRep);
var
I: Integer;
begin
for I := 0 to PageHeaderBand1.ControlCount - 1 do //設置頁頭的套打
begin
if PageHeaderBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
begin
TQRLabel(PageHeaderBand1.Controls[I]).Enabled := False;
if (PageHeaderBand1.Controls[I].Name = 'QRLabel25') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel11') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel8') or
(PageHeaderBand1.Controls[I].Name = 'QRLabel1') then
TQRLabel(PageHeaderBand1.Controls[I]).Enabled := True;
end
else
TQRLabel(PageHeaderBand1.Controls[I]).Enabled := True;
end;
if PageHeaderBand1.Controls[I] is TQRShape then
if Tao_Print_Flag then
TQRShape(PageHeaderBand1.Controls[i]).Enabled := False
else
TQRShape(PageHeaderBand1.Controls[i]).Enabled := True;
end;
for I := 0 to ColumnHeaderBand1.ControlCount - 1 do //設置表頭的套打
begin
if ColumnHeaderBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(ColumnHeaderBand1.Controls[I]).Enabled := False
else
TQRShape(ColumnHeaderBand1.Controls[I]).Enabled := True;
end;
if ColumnHeaderBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
TQRLabel(ColumnHeaderBand1.Controls[I]).Enabled := False
else
TQRLabel(ColumnHeaderBand1.Controls[I]).Enabled := True;
end;
end;
for I := 0 to DetailBand1.ControlCount - 1 do //設置表內容的套打
begin
if DetailBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(DetailBand1.Controls[I]).Enabled := False
else
TQRShape(DetailBand1.Controls[I]).Enabled := True;
end;
end;
for i := 0 to PageFooterBand1.ControlCount - 1 do //設置頁尾的套打
begin
if PageFooterBand1.Controls[I] is TQRLabel then
begin
if Tao_Print_Flag then
begin
TQRLabel(PageFooterBand1.Controls[I]).Enabled := False;
if (PageFooterBand1.Controls[I].Name = 'QRLabel29') then
TQRLabel(PageFooterBand1.Controls[I]).Enabled := True;
end
else
TQRLabel(PageFooterBand1.Controls[I]).Enabled := True;
end;
if PageFooterBand1.Controls[I] is TQRShape then
begin
if Tao_Print_Flag then
TQRShape(PageFooterBand1.Controls[I]).enabled := False
else
TQRShape(PageFooterBand1.Controls[I]).Enabled := True;
end;
if PageFooterBand1.Controls[i] is TQRRichText then
begin
if Printer.PageNumber = TotalPageCount then
TQRRichText(PageFooterBand1.Controls[I]).Enabled := True
else
TQRRichText(PageFooterBand1.Controls[I]).Enabled := False;
end;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -