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

📄 sy_ckjhdcx_rpt.pas

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

{*******************************************************}
{                                                       }
{                   出库计划单打印                      }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{               编制:中软金马项目开发组                }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在省级集邮票管理、省级市场购入票管理、省级集邮品管理、
省级零枚票管理、地市集邮票管理、地市集邮品管理、地市市场购入票管理七个模块调用
修改记录
修改,销价结算价结算金额显示小数点后3位 原来调用的CurrGetText替换为CurrGetText3 jhshao 2003.05.09
*)

unit SY_CKJHDCX_RPT;

interface

uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
  StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, DBTables  ;

type
  TCKJHDCX_RPT = class(TQuickRep)
    PageHeaderBand1: TQRBand;
    QRLab: TQRLabel;
    PageFooterBand1: TQRBand;
    QRLabel7: TQRLabel;
    QRLabel9: TQRLabel;
    Qry_Print: TQuery;
    QRLabel10: TQRLabel;
    QRDBText11: TQRDBText;
    DetailBand1: TQRBand;
    Qry_PrintROWNUM: TFloatField;
    Qry_PrintCKJHDH: TStringField;
    Qry_PrintCKXZ: TStringField;
    Qry_PrintZBR: TStringField;
    Qry_PrintPZR: TStringField;
    Qry_PrintZDRQ: TDateTimeField;
    Qry_PrintBZ: TStringField;
    Qry_PrintDWMC: TStringField;
    Qry_PrintPPMC: TStringField;
    Qry_PrintXJ: TFloatField;
    Qry_PrintZK: TFloatField;
    Qry_PrintJSJ: TFloatField;
    Qry_PrintFPSL: TFloatField;
    Qry_PrintJE: TFloatField;
    QRDBText3: TQRDBText;
    QRLabel12: TQRLabel;
    QRLabel13: TQRLabel;
    Qry_PrintZH: TStringField;
    QRLabel14: TQRLabel;
    QRLabel8: TQRLabel;
    QRSysData1: TQRSysData;
    ColumnHeaderBand1: TQRBand;
    QRLabel11: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRRichText1: TQRRichText;
    QRRichText2: TQRRichText;
    QRRichText3: TQRRichText;
    QRRichText4: TQRRichText;
    QRRichText5: TQRRichText;
    QRRichText6: TQRRichText;
    QRSysData2: TQRSysData;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel19: TQRLabel;
    QRLabel20: TQRLabel;
    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;
    procedure Qry_PrintJEGetText(Sender: TField; var Text: String;
      DisplayText: Boolean);
    procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QuickRepStartPage(Sender: TCustomQuickRep);
  private

  public
    DetailLines:Integer;
    Tao_Print_Flag:Boolean;
  end;

var
  CKJHDCX_RPT: TCKJHDCX_RPT;

implementation
uses pub,SJ_RichEdit;

{$R *.DFM}

procedure TCKJHDCX_RPT.Qry_PrintJEGetText(Sender: TField; var Text: String;
  DisplayText: Boolean);
begin
{修改,销价结算价结算金额显示小数点后3位 原来调用的CurrGetText替换为CurrGetText3 jhshao 2003.05.08}
  CurrGetText3(Sender, Text, DisplayText);
end;

procedure TCKJHDCX_RPT.QuickRepNeedData(Sender: TObject;
  var MoreData: Boolean);
begin

  DetailBand1.Height := 30 ;
  if DetailLines=6 then
    DetailLines:=1;
  if DetailLines<=5 then
    begin
      Inc(DetailLines);
      MoreData:=True;
    end;

  if not Qry_Print.Eof then
  begin
    Frm_RichEdit.RichEdit1.Width:=QRRichText2.Width;
    Frm_richEdit.RichEdit1.Lines.Clear;
    Frm_richEdit.RichEdit1.Lines.Text:=Qry_print.FieldByName('ppmc').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:=8;}
    end
    else begin
      QRRichText2.Font.Size :=11;
      //QRRichText2.Top :=1;
   end;

    Frm_RichEdit.RichEdit1.Width:=QRRichText1.Width;
    Frm_richEdit.RichEdit1.Lines.Clear;
    Frm_richEdit.RichEdit1.Lines.Text:=Qry_Print.FieldByName('zh').AsString;
    QRRichText1.Lines.Text:=Frm_richEdit.RichEdit1.Lines.Text;
    if QRRichText1.Lines.Count >1 then
    begin
      QRRichText1.Font.Size:=9;
      {if QRRichText1.Lines.Count>1 then
         QRRichText1.Top :=1
      else QRRichText1.Top:=8; }
    end
    else begin
      QRRichText1.Font.Size :=11;
//      QRRichText1.Top :=1;
    end;
  QRRichText1.Lines.Text:=Qry_Print.fieldbyname('zh').AsString;
  QRRichText2.Lines.Text:=Qry_Print.fieldbyname('ppmc').AsString;
{修改,销价结算金额显示小数点后3位 原来的#,##0.00替换为#,##0.000 jhshao 2003.05.08}
  QRRichText3.Lines.Text:=FormatFloat('#,##0.000',Qry_Print.fieldbyname('xj').AsFloat);
  QRRichText6.Lines.Text:=FormatFloat('#,##0.000',Qry_Print.fieldbyname('je').AsFloat);
  QRRichText4.Lines.Text:=FormatFloat('#,##',Qry_Print.fieldbyname('fpsl').AsFloat);
  QRRichText5.Lines.Text:=Qry_Print.fieldbyname('zk').AsString;
  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=6 then
      MoreData:=False;
  end;

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

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

procedure TCKJHDCX_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 = 'QRLabel12')or
            (PageHeaderBand1.Controls[I].Name = 'QRLabel20') 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 = 'QRLabel19')  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;
      end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -