⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sy_ckjhdone_more_rpt.pas

📁 省级集邮品管理ERP
💻 PAS
字号:

{*******************************************************}
{                                                       }
{                   出库计划单打印                      }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{               编制:中软金马项目开发组                }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在省级集邮票管理、省级集邮品管理、省级零枚票管理、
地市集邮票管理、地市集邮品管理五个模块调用
修改记录
修改,用于结算价和结算金额的显示小数点后扩到3位 jhshao 2003.05.08

*)
unit SY_CKJHDOne_More_RPT;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   ExtCtrls, QuickRpt, Db, DBTables, Qrctrls;
type
  TFrm_One_More_RPT = class(TQuickRep)
    Qry_Print: TQuery;
    ColumnHeaderBand1: TQRBand;
    DetailBand1: TQRBand;
    PageFooterBand1: TQRBand;
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel9: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel12: TQRLabel;
    QRShape1: TQRShape;
    QRLabel13: TQRLabel;
    QRLabel14: TQRLabel;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel19: TQRLabel;
    QRLabel20: TQRLabel;
    QRRichText2: TQRRichText;
    QRRichText3: TQRRichText;
    QRRichText4: TQRRichText;
    QRRichText5: TQRRichText;
    QRRichText6: TQRRichText;
    QRLabel21: TQRLabel;
    QRLabel22: TQRLabel;
    QRLabel23: TQRLabel;
    QRShape2: TQRShape;
    QRSysData1: TQRSysData;
    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;
    QRLabel24: TQRLabel;
    QRShape25: TQRShape;
    QRShape26: TQRShape;
    QRShape27: TQRShape;
    QRShape28: TQRShape;
    QRShape29: TQRShape;
    QRShape30: TQRShape;
    QRShape31: TQRShape;
    QRShape32: TQRShape;
    QRRichText1: TQRRichText;
    procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QuickRepStartPage(Sender: TCustomQuickRep);
  private
    { Private declarati
    ons }
  public
    { Public declarations }
    DetailLines:Integer;
    Tao_Print_Flag:Boolean;
    TotalPageCount:Integer;
  end;

var
  Frm_One_More_RPT: TFrm_One_More_RPT;

implementation

{$R *.DFM}

procedure TFrm_One_More_RPT.QuickRepNeedData(Sender: TObject;
  var MoreData: Boolean);
begin
  DetailBand1.Height :=25;
  if DetailLines<=33 then
  begin
    Inc(DetailLines);
    MoreData:=True;
  end;

  if not Qry_Print.Eof  then
  begin
    QRRichText1.Lines.text:=Qry_Print.FieldByName('rowNum').AsString;
    QRRichText2.Lines.Text :=Qry_Print.fieldbyname('dwmc').AsString;
    QRRichText3.Lines.Text :=FormatFloat('#,##',Qry_Print.fieldbyname('fpsl').AsFloat);
    QRRichText4.lines.text:=Qry_Print.FieldByName('zk').AsString;
{修改,结算价和结算金额显示小数点后3位 原来的#,##0.00替换为#,##0.000 jhshao 2003.05.08}
    QRRichText5.Lines.Text:=FormatFloat('#,##0.000',Qry_Print.FieldByName('jsj').AsFloat);
    QRRichText6.Lines.Text:=FormatFloat('#,##0.000',Qry_Print.fieldbyname('je').AsFloat);
   end;

  if MoreData and (Qry_Print.Eof) then
  begin
    QRRichtext1.lines.text:='';
    QRRichText3.Lines.Text := '';
    QRRichText4.Lines.Text := '';
    QRRichText5.Lines.Text :='';
    QRRichText6.Lines.Text := '';
    QRRichText2.Lines.text:='';
    if DetailLines=34 then
      MoreData:=False;
  end;

  if (not Qry_Print.Eof) then
  begin
    MoreData:= not Qry_Print.eof;
    Qry_Print.Next;
  end;
   if Detaillines=34 then
    DetailLines:=0;
end;

procedure TFrm_One_More_RPT.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  Qry_Print.First;
  Detaillines:=0;
end;

procedure TFrm_One_More_RPT.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 = 'QRLabel2') or
             (PageHeaderBand1.Controls[I].Name = 'QRLabel14') or
             (PageHeaderBand1.Controls[I].Name = 'QRLabel4') 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 = 'QRLabel24')  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)=QRLabel24.caption 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 + -