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

📄 sy_jypjfcyjb_rpt.pas

📁 省级集邮品管理ERP
💻 PAS
字号:
{*******************************************************}
{                                                       }
{                 进发存月结表查询打印                  }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{            编制:中软金马邮资票品项目开发组           }
{                                                       }
{                                                       }
{*******************************************************}
(*
省级集邮品,省级集邮票,省级零枚票,省级市场购入票
地市集邮品,地市集邮票,地市市场购入票,省级综合查询

*)
unit SY_JYPJFCYJB_RPT;

interface

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

type
  TJYPJFCYJB_RPT = class(TQuickRep)
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel12: TQRLabel;
    ColumnHeaderBand1: TQRBand;
    QRLabel9: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel13: TQRLabel;
    DetailBand1: TQRBand;
    QRRichText1: TQRRichText;
    QRRichText2: TQRRichText;
    QRRichText4: TQRRichText;
    QRRichText5: TQRRichText;
    QRRichText6: TQRRichText;
    QRRichText7: TQRRichText;
    QRRichText8: TQRRichText;
    QRRichText9: TQRRichText;
    QRRichText10: TQRRichText;
    QRRichText11: 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;
    PageFooterBand1: TQRBand;
    QRRichText15: TQRRichText;
    QRRichText16: TQRRichText;
    QRRichText17: TQRRichText;
    QRRichText18: TQRRichText;
    QRRichText19: TQRRichText;
    QRRichText20: TQRRichText;
    QRRichText21: TQRRichText;
    QRRichText22: TQRRichText;
    QRShape29: TQRShape;
    QRShape30: TQRShape;
    QRShape31: TQRShape;
    QRShape32: TQRShape;
    QRShape33: TQRShape;
    QRShape34: TQRShape;
    QRShape35: TQRShape;
    QRShape36: TQRShape;
    QRShape37: TQRShape;
    QRLabel14: TQRLabel;
    QRShape27: TQRShape;
    QRShape28: TQRShape;
    QRShape38: TQRShape;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel19: TQRLabel;
    QRLabel20: TQRLabel;
    QRSysData1: TQRSysData;
    QRShape39: TQRShape;
    QRLabel21: TQRLabel;
    QRLabel22: TQRLabel;
    QRLabel23: TQRLabel;
    QRLabel24: TQRLabel;
    QRLabel25: TQRLabel;
    QRLabel26: TQRLabel;
    QRLabel27: TQRLabel;
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QuickRepStartPage(Sender: TCustomQuickRep);
    procedure QuickRepAfterPreview(Sender: TObject);
  private

  public
    ND,YF: String;
    TotalPageCount:Integer;
    Tao_Print_Flag:Boolean;
    DetailLines:Integer;
    DataCount:Integer;
    sumPreCount,sumPreMoney,
    sumCount,sumMoney,sumjianCount,
    sumjianMoney,sumExistCount,
    sumExistMoney:double;
   end;

var
  JYPJFCYJB_RPT: TJYPJFCYJB_RPT;

implementation
uses SY_YPCBCX,sj_RichEdit;

{$R *.DFM}

procedure TJYPJFCYJB_RPT.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  Detaillines:=0;
  sumPreCount:=0;
  sumPreMoney:=0;
  sumCount:=0;
  sumMoney:=0;
  sumjianCount:=0;
  sumjianMoney:=0;
  sumExistCount:=0;
  sumExistMoney:=0;
  FrmY_YPCBCX.Qry_Search.First;
end;

procedure TJYPJFCYJB_RPT.QuickRepNeedData(Sender: TObject;
  var MoreData: Boolean);
begin
   DetailBand1.Height := 28 ;
    if DetailLines = 21 then
     DetailLines:=1;
    if DetailLines <= 20 then
    begin
      Inc(DetailLines);
      MoreData:=True;
    end;

  if not FrmY_YPCBCX.Qry_Search.Eof then
  begin
    with FrmY_YPCBCX.Qry_Search do
    begin
      if FieldByName('ppmc').AsString='  小计' then
      begin
        QRRichText15.Lines.Text := FormatFloat('#,##',FieldByName('syjcsl').AsFloat);
        QRRichText16.Lines.Text := FormatFloat('#,##0.00',FieldByName('syjcje').AsFloat);
        QRRichText17.Lines.Text := FormatFloat('#,##',FieldByName('byzjsl').AsFloat);
        QRRichText18.Lines.Text := FormatFloat('#,##0.00',FieldByName('byzjjjje').AsFloat);
        QRRichText19.Lines.Text :=FormatFloat('#,##',FieldByName('byjssl').AsFloat);
        QRRichText20.Lines.Text :=FormatFloat('#,##0.00',FieldByName('byjsxjje').AsFloat);
        QRRichText21.Lines.Text :=FormatFloat('#,##',FieldByName('sqkcsl').AsFloat);
        QRRichText22.Lines.Text :=FormatFloat('#,##0.00',FieldByName('kcjjje').AsFloat);
      end;

      Frm_RichEdit.RichEdit1.Width:=QRRichText2.Width;
      Frm_richEdit.RichEdit1.Lines.Clear;
      Frm_richEdit.RichEdit1.Lines.Text:=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 :=-4
        else QRRichText2.Top:=8;
      end
      else begin
        QRRichText2.Font.Size :=11;
        QRRichText2.Top :=3;
     end;

      Frm_RichEdit.RichEdit1.Width:=QRRichText1.Width;
      Frm_richEdit.RichEdit1.Lines.Clear;
      Frm_richEdit.RichEdit1.Lines.Text:=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 := FieldByName('zh').AsString;
      QRLabel27.Caption  := FormatFloat('#,##0.00',FieldByName('jj').AsFloat);
      QRRichText4.Lines.Text := FormatFloat('#,##',FieldByName('syjcsl').AsFloat);
      QRRichText5.Lines.Text :=FormatFloat('#,##0.00',FieldByName('syjcje').AsFloat);
      QRRichText6.Lines.Text := FormatFloat('#,##',FieldByName('byzjsl').AsFloat);
      QRRichText7.Lines.Text := FormatFloat('#,##0.00',FieldByName('byzjjjje').AsFloat);
      QRRichText8.Lines.Text := FormatFloat('#,##',FieldByName('byjssl').AsFloat);
      QRRichText9.Lines.Text := FormatFloat('#,##0.00',FieldByName('byjsxjje').AsFloat);
      QRRichText10.Lines.Text := FormatFloat('#,##',FieldByName('sqkcsl').AsFloat);
    //  QRRichText2.Lines.text:=FieldByName('ppmc').AsString;
      QRRichText11.Lines.Text :=FormatFloat('#,##0.00',FieldByName('kcjjje').AsFloat);

      sumPreCount:=sumPreCount+FieldByName('syjcsl').AsFloat;
      sumPreMoney:=sumPreMoney+FieldByName('syjcje').AsFloat;
      sumCount:=sumCount+FieldByName('byzjsl').AsFloat;
      sumMoney:=sumMoney+FieldByName('byzjjjje').AsFloat;
      sumjianCount:=sumjianCount+FieldByName('byjssl').AsFloat;
      sumjianMoney:=sumjianMoney+FieldByName('byjsxjje').AsFloat;
      sumExistCount:=sumExistCount+FieldByName('sqkcsl').AsFloat;
      sumExistMoney:=sumExistMoney+FieldByName('kcjjje').AsFloat;

      {QRRichText15.Lines.Text := FormatFloat('#,##',SumPreCount);
      QRRichText16.Lines.Text := FormatFloat('#,##0.00',SumPreMoney);
      QRRichText17.Lines.Text := FormatFloat('#,##',SumCount);
      QRRichText18.Lines.Text := FormatFloat('#,##0.00',sumMoney);
      QRRichText19.Lines.Text :=FormatFloat('#,##',sumjianCount);;
      QRRichText20.Lines.Text :=FormatFloat('#,##0.00',sumjianMoney);
      QRRichText21.Lines.Text :=FormatFloat('#,##',sumExistCount);;
      QRRichText22.Lines.Text :=FormatFloat('#,##0.00',sumExistMoney);}

    end;

  end;

  if MoreData and (FrmY_YPCBCX.Qry_Search.Eof) then
  begin
    QRRichText1.Lines.Text := '';
    QRlabel27.Caption  := '';
    QRRichText11.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=21 then
     MoreData:=False;
  end;

  if not FrmY_YPCBCX.Qry_Search.Eof then
  begin
      MoreData:= not FrmY_YPCBCX.Qry_Search.Eof;
      FrmY_YPCBCX.Qry_Search.Next;
  end;
end;

procedure TJYPJFCYJB_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 = 'QRLabel16')or
            (PageHeaderBand1.Controls[I].Name = 'QRLabel19') 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 = 'QRLabel20')  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 Self.QRPrinter.PageNumber =TotalPageCount then
        TQRRichText(PageFooterBand1.Controls[i]).Enabled:=True
        else
         TQRRichText(PageFooterBand1.Controls[i]).Enabled:=False;
      end;
      end;
end;

procedure TJYPJFCYJB_RPT.QuickRepAfterPreview(Sender: TObject);
begin
  Detaillines:=0;
  sumPreCount:=0;
  sumPreMoney:=0;
  sumCount:=0;
  sumMoney:=0;
  sumjianCount:=0;
  sumjianMoney:=0;
  sumExistCount:=0;
  sumExistMoney:=0;
end;

end.

⌨️ 快捷键说明

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