📄 uyldyzjtz.pas
字号:
unit uYLDYZJTZ;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
uPrintTemp, StdCtrls, QuickRpt, Spin;
type
TfrmYLDYZJTZ = class(TfrmPrintTemp)
QRCompositeReport1: TQRCompositeReport;
Label1: TLabel;
edtYear: TSpinEdit;
edtMonth: TSpinEdit;
Label2: TLabel;
Label3: TLabel;
procedure btnPreviewClick(Sender: TObject);
procedure QRCompositeReport1AddReports(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmYLDYZJTZ: TfrmYLDYZJTZ;
implementation
uses uYLDYZJTZ_1, uYLDYZJTZ_2, uCommon;
{$R *.DFM}
procedure TfrmYLDYZJTZ.btnPreviewClick(Sender: TObject);
begin
// inherited;
// Select * From tYLDYZJTZ_DW_REP
if Assigned(frmYLDYZJTZ_1) then
frmYLDYZJTZ_1 := nil;
if Assigned(frmYLDYZJTZ_2) then
frmYLDYZJTZ_2 := nil;
frmYLDYZJTZ_1 := TfrmYLDYZJTZ_1.Create(Self);
frmYLDYZJTZ_1.qryReport.SQL.Clear;
frmYLDYZJTZ_1.qryReport.SQL.Add('Select * From tYLDYZJTZ_HJ_REP');
frmYLDYZJTZ_1.qryReport.SQL.Add('WHERE TO_CHAR(yjrq,''YYYY'')=' +
IntToStr(edtYear.Value));
frmYLDYZJTZ_1.qryReport.SQL.Add(' AND TO_CHAR(yjrq,''MM'')=' +
IntToStr(edtMonth.Value));
frmYLDYZJTZ_1.qryReport.Open;
frmYLDYZJTZ_2 := TfrmYLDYZJTZ_2.Create(Self);
frmYLDYZJTZ_2.qryReport.SQL.Clear;
frmYLDYZJTZ_2.qryReport.SQL.Add('Select * From tYLDYZJTZ_DW_REP');
frmYLDYZJTZ_2.qryReport.SQL.Add('WHERE TO_CHAR(yjrq,''YYYY'')=' +
IntToStr(edtYear.Value));
frmYLDYZJTZ_2.qryReport.SQL.Add(' AND TO_CHAR(yjrq,''MM'')=' +
IntToStr(edtMonth.Value));
frmYLDYZJTZ_2.qryReport.Open;
if (frmYLDYZJTZ_1.qryReport.RecordCount <> 0) and
(frmYLDYZJTZ_2.qryReport.RecordCount <> 0) then
QRCompositeReport1.Preview
else
gfShowError('没有制定月份的月结数据');
frmYLDYZJTZ_1.Free;
frmYLDYZJTZ_2.Free;
end;
procedure TfrmYLDYZJTZ.QRCompositeReport1AddReports(Sender: TObject);
begin
with QRCompositeReport1 do
begin
Reports.Add(frmYLDYZJTZ_1.QuickRep1);
Reports.Add(frmYLDYZJTZ_2.QuickRep1);
end;
end;
procedure TfrmYLDYZJTZ.FormCreate(Sender: TObject);
begin
inherited;
edtYear.Value := StrToInt(FormatDateTime('YYYY', Now));
edtMonth.Value := StrToInt(FormatDateTime('MM', Now));
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -