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

📄 printsaleunit.pas

📁 安装完成后
💻 PAS
字号:
unit PrintSaleUnit;

interface

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

type
  TPrintSaleForm = class(TForm)
    QuickRep_ywyxstj: TQuickRep;
    PageFooterBand1: TQRBand;
    QRExpr11: TQRExpr;
    QRLabel12: TQRLabel;
    TitleBand1: TQRBand;
    QRL_coname: TQRLabel;
    QRS_TITLE: TQRSysData;
    QRExpr13: TQRExpr;
    QRL_printdate: TQRLabel;
    ColumnHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel9: TQRLabel;
    QRBand1: TQRBand;
    QRE_peoplename: TQRExpr;
    QRE_goodsname: TQRExpr;
    QRE_goodstype: TQRExpr;
    QRE_number: TQRExpr;
    QRE_price: TQRExpr;
    SummaryBand1: TQRBand;
    QRExpr7: TQRExpr;
    Query_data: TQuery;
    procedure FormCreate(Sender: TObject);
    procedure QuickRep_ywyxstjPreview(Sender: TObject);
    procedure Query_dataAfterScroll(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PrintSaleForm: TPrintSaleForm;

implementation

Uses MainUnit, QuerySaleUnit, FunctionUnit, PrintTempUnit;
{$R *.dfm}

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

procedure TPrintSaleForm.QuickRep_ywyxstjPreview(Sender: TObject);
begin
   with TPrintTempForm.Create(Application) do
   begin
  //  	QRP_print.QRPrinter := TQRPrinter(Sender);
    	PrintTempForm.CurRep := QuickRep_ywyxstj;
      show;
   end;
end;

procedure TPrintSaleForm.Query_dataAfterScroll(DataSet: TDataSet);
begin
 if qre_number.Value.dblResult < 0 then
   begin
      QRE_peoplename.Font.Color :=clred;
      qre_goodsname.Font.Color :=clred;
      qre_goodstype.Font.Color :=clred;
      qre_number.Font.Color :=clred;
      qre_price.Font.Color :=clred;
   end
   else
   begin
      QRE_peoplename.Font.Color :=clWindowText;
      qre_goodsname.Font.Color :=clWindowText;
      qre_goodstype.Font.Color :=clWindowText;
      qre_number.Font.Color :=clWindowText;
      qre_price.Font.Color :=clWindowText;
   end;
end;

end.

⌨️ 快捷键说明

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