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

📄 sy_ckjhdmore_more_rpt.pas

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

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

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  QuickRpt, Qrctrls, ExtCtrls, QRLine, Db, DBTables;

type
  TFrm_More_More_RPT = class(TQuickRep)
    DetailBand1: TQRBand;
    PageFooterBand1: TQRBand;
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRShape1: TQRShape;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    ColumnHeaderBand1: TQRBand;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    QRShape9: TQRShape;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel12: TQRLabel;
    QRLabel13: TQRLabel;
    QRLabel14: TQRLabel;
    QRLabel15: TQRLabel;
    QRLine1: TQRLine;
    QRLabel9: TQRLabel;
    QRLabel8: TQRLabel;
    QRShape10: TQRShape;
    QRRichText1: TQRRichText;
    QRShape11: TQRShape;
    QRShape12: TQRShape;
    QRShape13: TQRShape;
    QRRichText2: TQRRichText;
    QRRichText3: TQRRichText;
    QRShape14: TQRShape;
    QRRichText4: TQRRichText;
    QRShape15: TQRShape;
    QRRichText5: TQRRichText;
    QRShape16: TQRShape;
    QRShape17: TQRShape;
    QRRichText6: TQRRichText;
    QRRichText7: TQRRichText;
    QRShape18: TQRShape;
    QRShape19: TQRShape;
    QRLabel16: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    Qry_Print: TQuery;
    QRRichText8: TQRRichText;
    QRLabel19: TQRLabel;
    QRShape20: TQRShape;
    QRShape21: TQRShape;
    QRSysData1: TQRSysData;
    QRLabel20: TQRLabel;
    QRLabel21: TQRLabel;
    procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QuickRepStartPage(Sender: TCustomQuickRep);
  private
    { Private declarations }
  public
    { Public declarations }
    DetailLines: Integer;
    Tao_Print_Flag: Boolean;
  end;

var
  Frm_More_More_RPT: TFrm_More_More_RPT;

implementation
uses SJ_RichEdit;

{$R *.DFM}

procedure TFrm_More_More_RPT.QuickRepNeedData(Sender: TObject;
  var MoreData: Boolean);
begin
  if DetailLines <= 34 then
  begin
    Inc(Detaillines);
    MoreData := True;
  end;
  if not Qry_print.Eof then
  begin

    Frm_RichEdit.RichEdit1.Width := QRRichText3.Width;
    Frm_richEdit.RichEdit1.Lines.Clear;
    Frm_richEdit.RichEdit1.Lines.Text := Qry_Print.FieldByName('ppmc').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_print.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;

    QRRichTExt1.Lines.Text := Qry_Print.FieldbyName('dwmc').AsString;
    QrRichText2.Lines.Text := Qry_Print.fieldbyName('zh').AsString;
    QrRichText3.Lines.Text := Qry_Print.fieldbyName('ppmc').AsString;
{修改,进价和销价显示小数点后3位 原来的#,##0.00替换为#,##0.000 jhshao 2003.05.08}
    QrRichText4.Lines.Text := Formatfloat('#,##0.000', Qry_Print.fieldbyName('jj').Asfloat);
    QrRichText5.Lines.Text := FormatFloat('#,##0.000', Qry_Print.fieldbyName('xj').AsFloat);
    QrRichText7.Lines.Text := FormatFloat('#,##0.000', Qry_Print.fieldbyName('je').AsFloat);
    QRRichText8.Lines.Text := FormatFloat('#,##0.000', Qry_Print.fieldbyName('jsj').AsFloat);
    QrRichText6.Lines.Text := FormatFloat('#,##', Qry_Print.fieldbyName('fpsl').AsFloat);

  end;
  if MoreData and Qry_Print.eof then
  begin
    QRRichTExt1.Lines.Text := '';
    QrRichText2.Lines.Text := '';
    QrRichText3.Lines.Text := '';
    QrRichText4.Lines.Text := '';
    QrRichText5.Lines.Text := '';
    QrRichText6.Lines.Text := '';
    QrRichText7.Lines.Text := '';
    QRRichText8.Lines.Text := '';
    if Detaillines = 35 then
      MoreData := False;
  end;
  if not Qry_Print.Eof then
  begin
    MoreData := not Qry_Print.Eof;
    Qry_print.Next;
  end;
  if DetailLines = 35 then
    DetailLines := 0;
end;

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

procedure TFrm_More_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 = 'QRLabel1') or
          (PageHeaderBand1.Controls[I].Name = 'QRLabel5') or
          (PageHeaderBand1.Controls[I].Name = 'QRLabel4') or
          (PageHeaderBand1.Controls[I].Name = 'QRLabel21') 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;
    if ColumnHeaderBand1.Controls[i] is TQRline then
      if Tao_Print_Flag then
        TQRLine(ColumnHeaderBand1.Controls[i]).Enabled := False
      else
        TQRLine(ColumnHeaderBand1.Controls[i]).Enabled := True;

  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) = QRLabel21.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 + -