-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonthUnItemReportForm.pas
84 lines (69 loc) · 2.1 KB
/
MonthUnItemReportForm.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
unit MonthUnItemReportForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt, DB, DBClient, SimpleDS, QRCtrls;
type
TFormMonthUnItemReport = class(TForm)
MonthUnItemReport: TQuickRep;
ItemDataSet: TSimpleDataSet;
QRBand1: TQRBand;
TitleLabel: TQRLabel;
QRBand2: TQRBand;
QRLabel4: TQRLabel;
QRLabel3: TQRLabel;
QRLabel2: TQRLabel;
QRLabel1: TQRLabel;
QRBand3: TQRBand;
QRDBText4: TQRDBText;
QRDBText3: TQRDBText;
QRDBText1: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
ItemDataSetCount: TFloatField;
ItemDataSetBuildTime: TSQLTimeStampField;
ItemDataSetName: TWideStringField;
ItemDataSetDailySerial: TIntegerField;
ItemDataSetIsReturn: TWideStringField;
ItemDataSetBuildTimeStr: TStringField;
ItemDataSetState: TStringField;
QRDBText2: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
ItemDataSetUnit: TWideStringField;
procedure ItemDataSetCalcFields(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
procedure PrintMonthReport(Date: TDateTime);
end;
var
FormMonthUnItemReport: TFormMonthUnItemReport;
implementation
uses DataModule;
{$R *.dfm}
procedure TFormMonthUnItemReport.ItemDataSetCalcFields(DataSet: TDataSet);
begin
if (DataSet.FieldByName('Count').AsFloat < 0) then
begin
DataSet.FieldByName('State').AsString := '§R';
end;
if (DataSet.FieldByName('IsReturn').AsString = '01') then
begin
DataSet.FieldByName('State').AsString := '°h';
end;
DataSet.FieldByName('BuildTimeStr').AsString := FormatDateTime('yyyy/mm/dd', DataSet.FieldByName('BuildTime').AsDateTime);
end;
procedure TFormMonthUnItemReport.PrintMonthReport(Date: TDateTime);
begin
ItemDataSet.Close;
ItemDataSet.DataSet.ParamByName('Month').AsString := FormatDateTime('yyyy/mm', Date);
ItemDataSet.Open;
TitleLabel.Caption := FormatDateTime('yyyy ¦~ m ¤ë§R¡B°h«~³øªí', Date);
if DM.IsPrintPreview then
MonthUnItemReport.PreviewModal
else
MonthUnItemReport.Print;
end;
end.