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

📄 printspjxcunit.pas

📁 好用得程序
💻 PAS
字号:
unit PrintspjxcUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, QRCtrls, QuickRpt, ExtCtrls, QRPrntr;

type
  TPrintspjxcForm = class(TForm)
    QuickRep_spjxcmx: TQuickRep;
    DetailBand1: TQRBand;
    QRE_username: TQRExpr;
    QRE_date: TQRExpr;
    QRE_depot: TQRExpr;
    QRE_name: TQRExpr;
    QRE_type: TQRExpr;
    QRE_num: TQRExpr;
    QRE_price: TQRExpr;
    QRE_jxc: TQRExpr;
    QRE_memo: TQRExpr;
    PageFooterBand1: TQRBand;
    QRExpr11: TQRExpr;
    TitleBand1: TQRBand;
    QRS_TITLE: TQRSysData;
    QRL_coname: TQRLabel;
    QRExpr13: TQRExpr;
    QRL_printdate: TQRLabel;
    ColumnHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel9: TQRLabel;
    Query_data: TQuery;
    procedure FormCreate(Sender: TObject);
    procedure QuickRep_spjxcmxPreview(Sender: TObject);
    procedure Query_dataAfterScroll(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PrintspjxcForm: TPrintspjxcForm;

implementation

uses FunctionUnit, MainUnit, QueryspjxcUnit, PrintBassUnit;

{$R *.dfm}

procedure TPrintspjxcForm.FormCreate(Sender: TObject);
begin
  qrl_coname.Caption := S_name;
  QRL_printdate.Caption := '统计日期:' + formatdatetime('yyyy-mm-dd', QueryspjxcForm.DTP_begin.DateTime)
    + ' 至 ' + formatdatetime('yyyy-mm-dd', QueryspjxcForm.DTP_end.DateTime);
  if QueryspjxcForm.CB_DEPOT.Text = '' then
    QRS_TITLE.Text := QRS_TITLE.Text + '(所有)'
  else
    QRS_TITLE.Text := QRS_TITLE.Text + '(' + QueryspjxcForm.CB_DEPOT.Text + ')';
  with query_data do
  begin
    DatabaseName := 'CPXSGL';
    close;
    sql.Clear;
    SQL.Text := QueryspjxcForm.Query_data.SQL.Text;
    try
      if not (SQL.Text = '') then Open;
    except
      messagedlg(Errormsg0001 + '0000', mtError, [mbok], 0);
      close;
    end;
  end;
end;

procedure TPrintspjxcForm.QuickRep_spjxcmxPreview(Sender: TObject);
begin
  with TprintBassForm.Create(Application) do
  begin
    QRP_print.QRPrinter := TQRPrinter(Sender);
    show;
  end;
end;

procedure TPrintspjxcForm.Query_dataAfterScroll(DataSet: TDataSet);
begin
  if (trim(QRE_jxc.Value.strResult) = '进货退货') or (trim(QRE_jxc.Value.strResult) = '销售退货') then
  begin
    QRE_depot.Font.Color := clred;
    QRE_date.Font.Color := clred;
    QRE_jxc.Font.Color := clred;
    QRE_name.Font.Color := clred;
    QRE_type.Font.Color := clred;
    QRE_num.Font.Color := clred;
    QRE_price.Font.Color := clred;
    QRE_username.Font.Color := clred;
    QRE_memo.Font.Color := clred;
  end
  else if (trim(QRE_jxc.Value.strResult) = '进货') or (trim(QRE_jxc.Value.strResult) = '期初') then
  begin
    QRE_depot.Font.Color := clblue;
    QRE_date.Font.Color := clblue;
    QRE_jxc.Font.Color := clblue;
    QRE_name.Font.Color := clblue;
    QRE_type.Font.Color := clblue;
    QRE_num.Font.Color := clblue;
    QRE_price.Font.Color := clblue;
    QRE_username.Font.Color := clblue;
    QRE_memo.Font.Color := clblue;
  end
  else
  begin
    QRE_depot.Font.Color := clWindowText;
    QRE_date.Font.Color := clWindowText;
    QRE_jxc.Font.Color := clWindowText;
    QRE_name.Font.Color := clWindowText;
    QRE_type.Font.Color := clWindowText;
    QRE_num.Font.Color := clWindowText;
    QRE_price.Font.Color := clWindowText;
    QRE_username.Font.Color := clWindowText;
    QRE_memo.Font.Color := clWindowText;
  end;
end;

end.

⌨️ 快捷键说明

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