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

📄 gf_print.pas

📁 省级集邮品管理ERP
💻 PAS
字号:
{*******************************************************}
{                                                       }
{                   邮票发行计划打印                    }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{            编制:中软金马邮资票品项目开发组           }
{                                                       }
{                                                       }
{*******************************************************}
(*
省级综合查询,省级系统管理
*)

unit GF_print;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, ExtCtrls, quickrpt, DB, DBTables, Qrctrls;

type
  TFrmf_print = class(TForm)
    QRe_pfx1: TQuickRep;
    DetailBand1: TQRBand;
    PageFooterBand1: TQRBand;
    TitleBand1: TQRBand;
    QRLabel6: TQRLabel;
    QRSysData1: TQRSysData;
    QRSysData2: TQRSysData;
    QRShape2: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRLabel7: TQRLabel;
    QRShape5: TQRShape;
    QRLabel8: TQRLabel;
    QRLabel2: TQRLabel;
    QRShape7: TQRShape;
    QRShape1: TQRShape;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape11: TQRShape;
    QRShape13: TQRShape;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel9: TQRLabel;
    QRShape14: TQRShape;
    QRShape16: TQRShape;
    QRShape17: TQRShape;
    QRLabel10: TQRLabel;

    QRRT_xh_pfx1: TQRRichText;
    QRRT_tmc_pfx1: TQRRichText;
    QRRT_ms_pfx1: TQRRichText;
    QRRT_fxrq_pfx1: TQRRichText;
    QRRT_gg_pfx1: TQRRichText;
    QRRT_qtmz_pfx1: TQRRichText;
    QRRT_gmmz_pfx1: TQRRichText;
    QRRT_sm_pfx1: TQRRichText;
    QRShape6: TQRShape;
    QRLabel1: TQRLabel;
    QRRichText1: TQRRichText;
    QRLabel11: TQRLabel;
    QRLabel12: TQRLabel;
    QRe_ffx: TQuickRep;
    DetailBand2: TQRBand;
    QRShape8: TQRShape;
    QRShape15: TQRShape;

    QRRT_tmc_ffx: TQRRichText;
    QRShape18: TQRShape;
    QRRT_mz_ffx: TQRRichText;
    QRRT_xh_ffx: TQRRichText;
    QRRT_ms_ffx: TQRRichText;
    QRRT_fxrq_ffx: TQRRichText;
    QRBand2: TQRBand;
    QRSysData3: TQRSysData;
    QRSysData4: TQRSysData;
    QRBand3: TQRBand;
    QRShape20: TQRShape;
    QRLabel13: TQRLabel;
    QRShape21: TQRShape;
    QRShape22: TQRShape;
    QRLabel14: TQRLabel;
    QRShape23: TQRShape;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRShape24: TQRShape;
    QRShape25: TQRShape;
    QRLabel17: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel23: TQRLabel;
    QRLabel24: TQRLabel;
    QRRT_lb_ffx: TQRRichText;

    procedure QRe_pfx1NeedData(Sender: TObject; var MoreData: Boolean);
    procedure QRe_pfx1BeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QRe_ffxNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QRe_ffxBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
  private
    { Private declarations }
  public

    procedure Pnt_init(modID: integer; rqp_dataset: TDataSet);
    { Public declarations }
  end;

var
  Frmf_print: TFrmf_print;

implementation
uses datas, GF_pfxjh, GF_ffxjh;

{$R *.DFM}

procedure TFrmf_print.Pnt_init(modID: integer; rqp_dataset: TDataSet);
var
  i: integer;
begin
  case modID of
  1:
    for i := 0 to DetailBand1.ControlCount -1 do
    begin
      if (DetailBand1.Controls[i] is TQRDBText) then
        (DetailBand1.Controls[i] as TQRDBText).DataSet := rqp_dataset;
    end;
  end;

end;

procedure TFrmf_print.QRe_pfx1NeedData(Sender: TObject;
  var MoreData: Boolean);
var
  vlp_i_max: integer;
  vlp_s_gmmz: string;
  vlp_s_gg: string;
  i: integer;
begin

  with Frmf_pfxjh.DBGid_tao.DataSource.DataSet do
  begin
    QRRT_xh_pfx1.Lines.Text := fieldbyname('xh').asstring;
    QRRT_tmc_pfx1.Lines.Text := fieldbyname('tmc').asstring;
    QRRT_ms_pfx1.Lines.Text := fieldbyname('qtms').asstring;
    QRRT_fxrq_pfx1.Lines.Text := fieldbyname('fxrq').asstring;
    QRRT_qtmz_pfx1.Lines.Text := fieldbyname('qtmz').asstring;
    QRRT_sm_pfx1.Lines.Text := fieldbyname('bz').asstring;

  end;

  with Frmf_pfxjh.DBGid_tu.DataSource.DataSet do
  begin
    First;
    vlp_s_gg := FieldByName('gg').AsString;
    while not Eof do
    begin
      if (FieldByName('MZ').AsFloat > 100) then
        vlp_s_gmmz := vlp_s_gmmz + Floattostr(FieldByName('MZ').AsFloat/100) + '元,'
      else
        vlp_s_gmmz := vlp_s_gmmz + Floattostr(FieldByName('MZ').AsFloat) + '分,';
      Next;
    end;
  end;
  vlp_s_gmmz := copy(vlp_s_gmmz, 1,Length(vlp_s_gmmz)-1);
  QRRT_gmmz_pfx1.Lines.Text := vlp_s_gmmz;
  QRRT_gg_pfx1.Lines.Text := vlp_s_gg;

  vlp_i_max := 1;
  for i := 0 to DetailBand1.ControlCount -1 do
  begin
    if (DetailBand1.Controls[i] is TQRRichText) then
      if (DetailBand1.Controls[i] as TQRRichText).Lines.Count > vlp_i_max then
      begin
        vlp_i_max := (DetailBand1.Controls[i] as TQRRichText).Lines.Count;
      end;
  end;

  DetailBand1.Height := (vlp_i_max )*12 + 3 ;

  for i := 0 to DetailBand1.ControlCount -1 do
  begin
    if (DetailBand1.Controls[i] is TQRShape) then
      DetailBand1.Controls[i].Height := DetailBand1.Height ;
  end;

  MoreData := not Frmf_pfxjh.DBGid_tao.DataSource.DataSet.Eof;
  if MoreData then
    Frmf_pfxjh.DBGid_tao.DataSource.DataSet.Next;

end;

procedure TFrmf_print.QRe_pfx1BeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  Frmf_pfxjh.DBGid_tao.DataSource.DataSet.First;
end;

procedure TFrmf_print.QRe_ffxNeedData(Sender: TObject;
  var MoreData: Boolean);
var
  vlp_i_max: integer;
  vlp_s_tumz: string;

  i: integer;
begin

  with Frmf_ffxjh.DBGid_tao.DataSource.DataSet do
  begin
    QRRT_xh_ffx.Lines.Text := fieldbyname('xh').asstring;
    QRRT_tmc_ffx.Lines.Text := fieldbyname('tmc').asstring;
    QRRT_lb_ffx.Lines.Text := fieldbyname('pplbmc').asstring;
    QRRT_fxrq_ffx.Lines.Text := fieldbyname('fxrq').asstring;
    QRRT_ms_ffx.Lines.Text := fieldbyname('qtms').asstring;
  end;

  with Frmf_ffxjh.DBGid_tu.DataSource.DataSet do
  begin
    First;
    if (FieldByName('MZ').AsFloat > 100) then
      vlp_s_tumz := Floattostr(FieldByName('MZ').AsFloat/100) + '元'
    else
      vlp_s_tumz := Floattostr(FieldByName('MZ').AsFloat) + '分';
  end;
  QRRT_mz_ffx.Lines.Text := vlp_s_tumz;

  vlp_i_max := 1;
  for i := 0 to DetailBand2.ControlCount -1 do
  begin
    if (DetailBand2.Controls[i] is TQRRichText) then
      if (DetailBand2.Controls[i] as TQRRichText).Lines.Count > vlp_i_max then
      begin
        vlp_i_max := (DetailBand2.Controls[i] as TQRRichText).Lines.Count;
      end;
  end;

  DetailBand2.Height := (vlp_i_max )*12 + 3 ;

  for i := 0 to DetailBand2.ControlCount -1 do
  begin
    if (DetailBand2.Controls[i] is TQRShape) then
      DetailBand2.Controls[i].Height := DetailBand2.Height ;
  end;

  MoreData := not Frmf_ffxjh.DBGid_tao.DataSource.DataSet.Eof;
  if MoreData then
    Frmf_ffxjh.DBGid_tao.DataSource.DataSet.Next;
end;

procedure TFrmf_print.QRe_ffxBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin
  Frmf_ffxjh.DBGid_tao.DataSource.DataSet.First;
end;

end.

⌨️ 快捷键说明

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