You've already forked lazarus-ccr
tvplanit: Fix Fulldemo's Print routine.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5048 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -42,7 +42,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Units Count="4">
|
||||
<Unit0>
|
||||
<Filename Value="demo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -59,6 +59,13 @@
|
||||
<Filename Value="sound.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="ExVpRptSetup.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="frmReportSetup"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -150,7 +150,7 @@ uses
|
||||
LCLVersion, LResources, LazFileUtils, LazUTF8, StrUtils, DateUtils, Translations,
|
||||
IniFiles, Math, Printers,
|
||||
VpMisc, VpPrtFmt,
|
||||
sound;
|
||||
sound, ExVpRptSetup;
|
||||
|
||||
{$UNDEF UTF8_CALLS}
|
||||
{$IFDEF LCL}
|
||||
@ -401,14 +401,30 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainForm.MnuPrintClick(Sender: TObject);
|
||||
var
|
||||
F: TfrmReportSetup;
|
||||
begin
|
||||
if PrintDialog1.Execute then begin
|
||||
Printer.BeginDoc;
|
||||
{
|
||||
VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format);
|
||||
VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate);
|
||||
}
|
||||
Printer.EndDoc;
|
||||
if ReportData.StartDate = 0 then
|
||||
ReportData.StartDate := VpMonthView1.Date;
|
||||
if ReportData.EndDate = 0 then
|
||||
ReportData.EndDate := VpMonthView1.Date;
|
||||
if ReportData.Format = '' then
|
||||
ReportData.Format := VpControlLink1.Printer.PrintFormats.Items[0].FormatName;
|
||||
|
||||
F := TfrmReportSetup.Create(nil);
|
||||
try
|
||||
F.ControlLink := VpControlLink1;
|
||||
if not F.Execute(ReportData) then
|
||||
exit;
|
||||
|
||||
if PrintDialog1.Execute then begin
|
||||
Printer.BeginDoc;
|
||||
VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format);
|
||||
VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate);
|
||||
Printer.EndDoc;
|
||||
end;
|
||||
finally
|
||||
F.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user