📄 zdxsrep.pas
字号:
unit zdxsrep;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, ADODB, StdCtrls, Buttons, ExtCtrls, ComCtrls,
QuickRpt, QRCtrls, Mask, DBCtrls;
type
TzdxsForm = class(TForm)
DBGrid1: TDBGrid;
detail1DS: TDataSource;
Shape1: TShape;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Label1: TLabel;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
Label2: TLabel;
DateTimePicker3: TDateTimePicker;
DateTimePicker4: TDateTimePicker;
Panel2: TPanel;
QuickRep2: TQuickRep;
detail1: TQRBand;
QRBand2: TQRBand;
QRSysData4: TQRSysData;
QRSubDetailItems2: TQRSubDetail;
QRDBOrderNo: TQRDBText;
QRDBSalesDate: TQRDBText;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
ColumnHeaderBand2: TQRBand;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel20: TQRLabel;
QRShape4: TQRShape;
QRShape5: TQRShape;
DBGrid2: TDBGrid;
DBGrid3: TDBGrid;
mainDS: TDataSource;
Label3: TLabel;
DBEdit1: TDBEdit;
detail2DS: TDataSource;
QRLabel12: TQRLabel;
QRDBText8: TQRDBText;
QRDBText12: TQRDBText;
QRDBText13: TQRDBText;
mainDtSt: TADODataSet;
mainDtStdjh: TIntegerField;
mainDtStszdd: TStringField;
detail1DtSt: TADODataSet;
detail2DtST: TADODataSet;
detail1DtStdjh: TIntegerField;
detail1DtStth: TStringField;
detail1DtStmc: TStringField;
detail1DtStdj: TBCDField;
detail1DtStje: TBCDField;
detail1DtStfwfe: TBCDField;
detail1DtStzke: TBCDField;
detail1DtStszdd: TStringField;
detail1DtStrq: TDateTimeField;
detail2DtSTdjh: TIntegerField;
detail2DtSTfkfsmc: TStringField;
detail2DtSTfkje: TBCDField;
detail2DtSTszdd: TStringField;
detail2DtSTrq: TDateTimeField;
QRShape7: TQRShape;
QRDBText11: TQRDBText;
QRDBText10: TQRDBText;
QRDBText14: TQRDBText;
detail2: TQRBand;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel2: TQRLabel;
QRLabel6: TQRLabel;
QRLabel8: TQRLabel;
QRLabel10: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel23: TQRLabel;
QRDBText1: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRSysData3: TQRSysData;
QRLabel19: TQRLabel;
QRSubDetailItems1: TQRSubDetail;
QRDBText15: TQRDBText;
QRDBText16: TQRDBText;
QRDBText17: TQRDBText;
QRShape8: TQRShape;
QRShape9: TQRShape;
mainDtStjyje: TBCDField;
QRBand1: TQRBand;
QRLabel13: TQRLabel;
QRExpr1: TQRExpr;
QRShape1: TQRShape;
detail1DtStsl: TBCDField;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
zdxsForm: TzdxsForm;
implementation
uses rjsmain;
{$R *.dfm}
procedure TzdxsForm.BitBtn1Click(Sender: TObject);
begin
mainDtSt.Active := false;
datetimepicker1.Time:=datetimepicker2.Time;
datetimepicker3.Time:=datetimepicker4.Time;
mainDtSt.Parameters.ParamByName('cs1').Value := datetimepicker1.DateTime;
mainDtSt.Parameters.ParamByName('cs2').Value := datetimepicker3.DateTime;
mainDtSt.Active := true;
Detail1DtSt.Active := false;
Detail1DtSt.CommandText := 'Select djh, th, mc, dj,sl,je,fwfe,zke,szdd,rq From dcd where zfbz=0 and fkbz=1 and rq between '+''''+datetimetostr(DateTimePicker1.DateTime)+''''+' and '+''''+datetimetostr(DateTimePicker3.DateTime)+'''';
Detail1DtSt.Active := true;
Detail2DtSt.Active := false;
Detail2DtSt.CommandText := 'SELECT djh,fkfsmc,fkje,szdd,rq FROM fkwj where rq between '+''''+datetimetostr(DateTimePicker1.DateTime)+''''+' and '+''''+datetimetostr(DateTimePicker3.DateTime)+'''';
Detail2DtSt.Active := true;
end;
procedure TzdxsForm.BitBtn2Click(Sender: TObject);
begin
if (not mainDtSt.Active)or(mainDtSt.IsEmpty) then
exit;
messagedlg('请插入B4纸!',mtinformation,[mbok],0);
qrlabel16.Caption:=datetimetostr(datetimepicker1.DateTime)+' 到 '+datetimetostr(datetimepicker3.DateTime);
quickrep2.Preview;
end;
procedure TzdxsForm.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure TzdxsForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if mainDtSt.Active then mainDtSt.Close;
end;
procedure TzdxsForm.FormActivate(Sender: TObject);
begin
if mainDtSt.Active then exit;
datetimepicker1.Date:=date;
datetimepicker3.Date:=date;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -