?? sj_rkddy.pas
字號:
{*******************************************************}
{ }
{ 集郵品入庫通知單打印 }
{ }
{ 中軟金馬公司版權所有。2002.12前 }
{ }
{ 編制:中軟金馬郵資票品項目開發組 }
{ }
{ }
{*******************************************************}
(*
省級集郵品,省級市場購入票,省級集郵票管理,省級零枚票管理
地市集郵品,地市市場購入票,地市集郵票管理
修改記錄
1。將入庫調整為常用打印紙大小 by jhshao 2003.05.07
*)
unit SJ_RKDDY;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Dialogs, Db, DBTables;
type
TFrmK_JYRKDDY = class(TQuickRep)
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel6: TQRLabel;
QRLabel8: TQRLabel;
QRLabel25: TQRLabel;
QRLabel4: TQRLabel;
Qry_ckdayin: TQuery;
Qry_bz: TQuery;
QRLabel11: TQRLabel;
QRLabel10: TQRLabel;
PageFooterBand1: TQRBand;
QRLabel13: TQRLabel;
QRRichText1: TQRRichText;
QRRichText11: TQRRichText;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel2: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRSysData1: TQRSysData;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel9: TQRLabel;
QRLabel23: TQRLabel;
QRLabel12: TQRLabel;
QRLabel22: TQRLabel;
QRLabel3: TQRLabel;
QRLabel16: TQRLabel;
QRLabel5: TQRLabel;
QRLabel17: TQRLabel;
QRLabel24: TQRLabel;
QRLabel18: TQRLabel;
QRLabel7: TQRLabel;
DetailBand1: TQRBand;
QRRichText2: TQRRichText;
QRRichText3: TQRRichText;
QRRichText4: TQRRichText;
QRRichText6: TQRRichText;
QRRichText5: TQRRichText;
QRRichText7: TQRRichText;
QRRichText8: TQRRichText;
QRRichText9: TQRRichText;
QRRichText10: 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;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRShape26: TQRShape;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRShape29: TQRShape;
QRShape30: TQRShape;
QRShape31: TQRShape;
QRShape32: TQRShape;
QRShape33: TQRShape;
procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRepStartPage(Sender: TCustomQuickRep);
private
function SetPntFmtstr(p_i_type: integer; p_f_val: double): string;
public
nheight: integer;
sumzj: double;
sumjsj: double;
DetailLines: Integer;
Tao_Print_Flag: Boolean;
end;
var
FrmK_JYRKDDY: TFrmK_JYRKDDY;
implementation
uses SJ_RICHEDIT;
{$R *.DFM}
procedure TFrmK_JYRKDDY.QuickRepNeedData(Sender: TObject;
var MoreData: Boolean);
var
vlp_i_max, i, j: integer;
zjje, jsje: double;
begin
if DetailLines = 6 then
DetailLines := 1;
if DetailLines <= 5 then
begin
Inc(DetailLines);
MoreData := True;
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;
QRRichText2.Lines.Text := Frm_richEdit.RichEdit1.Lines.Text;
if QRRichText2.Lines.Count > 1 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 := SetPntFmtstr(1, Qry_ckdayin.fieldbyname('sl').AsFloat);
QRRichText6.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('xj').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;
QRRichText9.Lines.Text := SetPntFmtstr(0, Qry_ckdayin.fieldbyname('jsje').AsFloat);
QRRichText10.Lines.Text := Qry_ckdayin.fieldbyname('kfmc').asstring;
jsje := Qry_ckdayin.fieldbyname('jsje').asfloat;
sumzj := sumzj + zjje;
QRRichText1.Lines.Text := SetPntFmtstr(0, sumzj);
sumjsj := sumjsj + jsje;
QRRichText11.Lines.Text := SetPntFmtstr(0, sumjsj);
DetailBand1.Height := 28;
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 DetailLines = 6 then
MoreData := False;
end;
if (not Qry_ckdayin.Eof) then
begin
MoreData := not Qry_ckdayin.eof;
Qry_ckdayin.Next;
end;
end;
procedure TFrmK_JYRKDDY.QuickRepBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
Qry_ckdayin.First;
sumzj := 0;
sumjsj := 0;
DetailLines := 0;
end;
procedure TFrmK_JYRKDDY.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 IntToStr(Printer.PageNumber) = QRLabel29.caption then
TQRRichText(PageFooterBand1.Controls[I]).Enabled := True
else
TQRRichText(PageFooterBand1.Controls[I]).Enabled := False;
end;
end;
end;
function TFrmK_JYRKDDY.SetPntFmtstr(p_i_type: integer; p_f_val: double): string;
begin
Result := '';
case p_i_type of
0: //curr
Result := FormatFloat('#,##0.00##', p_f_val);
1: //mount
Result := FormatFloat('#,##', p_f_val);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -