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

📄 jm_kcdetail_rpt.pas

📁 省级集邮品管理ERP
💻 PAS
字号:
{*******************************************************}
{                                                       }
{              库存量一览表(营业员库存)打印             }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{            编制:中软金马邮资票品项目开发组           }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在地市pub库存量一览表模块里面调用。

*)

unit JM_KCDetail_RPT;

interface

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

type
  TQuickReport1 = class(TQuickRep)
    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;
    Qry_yyykc: TQuery;
    Qry_any: TQuery;
    Qry_temp: TQuery;
    QRRichText1: TQRRichText;
    QRRichText2: TQRRichText;
    QRRichText3: TQRRichText;
    QRRichText4: TQRRichText;
    QRRichText5: TQRRichText;
    QRRichText6: 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;
    QRLabel12: TQRLabel;
    QRRichText11: TQRRichText;
    QRRichText12: TQRRichText;
    QRShape26: TQRShape;
    QRShape27: TQRShape;
    QRLabel13: TQRLabel;
    QRShape28: TQRShape;
    QRShape29: TQRShape;
    procedure QuickRepNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QuickRepBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
  private

  public
    ygmc:array of string;
    sl:array of string;
  end;

var
  QuickReport1: TQuickReport1;

implementation

{$R *.DFM}

procedure TQuickReport1.QuickRepNeedData(Sender: TObject;
  var MoreData: Boolean);
var
  i:Integer;
begin
  i:=0;
  setlength(ygmc,Qry_temp.recordcount);
  setLength(sl,Qry_temp.RecordCount);
  Qry_temp.First;
  while not Qry_temp.eof do
  begin
    with Qry_any do
    begin
      Close;
      Sql.Clear;
      Sql.Add('select  sum(sl) sl from tm_yyykc where ygdm='''+Qry_temp.FieldByName('ygdm').AsString +''' and ppdm='''+ Qry_yyykc.FieldByName('ppdm').AsString+''' and jj/100 ='+VarToStr(Qry_yyykc.FieldByName('jj').AsFloat));
      Open;
    end;
    ygmc[i]:=Qry_temp.FieldByName('ygmc').AsString;
    sl[i]:=FormatFloat('#,##',Qry_any.FieldByName('sl').AsFloat);
    Inc(i);
    Qry_temp.Next;
  end;
  QRRichText1.Lines.Text:=Qry_yyykc.fieldbyname('zh').AsString;
  QRRichText2.Lines.Text:=Qry_yyykc.fieldbyname('ppmc').AsString;
  if QRRichText2.Lines.Count=1 then
  begin
    QRRichText2.Height :=QRRichText1.Height;
    QRRichText2.Top :=QRRichText1.Top;
  end;
  if QRRichText2.Lines.Count >=2 then
  begin
    QRRichText2.Height :=27;
    QRRichText2.Top :=3;
  end;
  QRRichText4.Lines.Text:=FormatFloat('#,##',Qry_yyykc.fieldbyname('sl').AsFloat);
  QRRichText3.Lines.Text:=FormatFloat('#,##0.00',Qry_yyykc.fieldbyname('jj').AsFloat);
  if i=1 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
  end;
  if i=2 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
  end;
  if i=3 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
  end;
  if i=4 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
    QRlabel9.Caption:=ygmc[3];
    QRRichText8.Lines.Text:=sl[3];
  end;
  if i=5 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
    QRlabel9.Caption:=ygmc[3];
    QRRichText8.Lines.Text:=sl[3];
    QRlabel10.Caption:=ygmc[4];
    QRRichText9.Lines.Text:=sl[4];
  end;
  if i=6 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
    QRlabel9.Caption:=ygmc[3];
    QRRichText8.Lines.Text:=sl[3];
    QRlabel10.Caption:=ygmc[4];
    QRRichText9.Lines.Text:=sl[4];
    QRlabel11.Caption:=ygmc[5];
    QRRichText10.Lines.Text:=sl[5];
  end;
  if i=7 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
    QRlabel9.Caption:=ygmc[3];
    QRRichText8.Lines.Text:=sl[3];
    QRlabel10.Caption:=ygmc[4];
    QRRichText9.Lines.Text:=sl[4];
    QRlabel11.Caption:=ygmc[5];
    QRRichText10.Lines.Text:=sl[5];
    QRlabel12.Caption:=ygmc[6];
    QRRichText11.Lines.Text:=sl[6];
  end;
  if i>=8 then
  begin
    QRlabel6.Caption:=ygmc[0];
    QRRichText5.Lines.Text:=sl[0];
    QRlabel7.Caption:=ygmc[1];
    QRRichText6.Lines.Text:=sl[1];
    QRlabel8.Caption:=ygmc[2];
    QRRichText7.Lines.Text:=sl[2];
    QRlabel9.Caption:=ygmc[3];
    QRRichText8.Lines.Text:=sl[3];
    QRlabel10.Caption:=ygmc[4];
    QRRichText9.Lines.Text:=sl[4];
    QRlabel11.Caption:=ygmc[5];
    QRRichText10.Lines.Text:=sl[5];
    QRlabel12.Caption:=ygmc[6];
    QRRichText11.Lines.Text:=sl[6];
    QRlabel13.Caption:=ygmc[7];
    QRRichText12.Lines.Text:=sl[7];
  end;
 MoreData:=not Qry_yyykc.Eof ;
 if not Qry_yyykc.Eof  then Qry_yyykc.Next;
end;

procedure TQuickReport1.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  Qry_yyykc.First;
end;

end.

⌨️ 快捷键说明

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