mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:29:25 +02:00
LazReport: lrCodeReport RunReport procedure now takes an argument for optionally showing the report after run
git-svn-id: trunk@49760 -
This commit is contained in:
parent
bb8c94cba4
commit
8804bbadce
@ -108,7 +108,7 @@ type
|
||||
procedure SetPaper(ASize: integer; AOr: TPrinterOrientation = poPortrait;
|
||||
AWidth: integer = 0; AHeight: integer = 0);
|
||||
procedure SetRatio(X, Y: double);
|
||||
procedure RunReport;
|
||||
procedure RunReport(aShowPreview: boolean = true);
|
||||
procedure SetFont(AName: string; ASize: integer; AStyle: TFontStyles = []);
|
||||
procedure NewLine(i: word = 1);
|
||||
procedure NewPage;
|
||||
@ -257,11 +257,12 @@ begin
|
||||
YRatio := Y;
|
||||
end;
|
||||
|
||||
procedure TlrCodeReport.RunReport;
|
||||
procedure TlrCodeReport.RunReport(aShowPreview: boolean = true);
|
||||
begin
|
||||
if Assigned(OnBeginReport) then
|
||||
OnBeginReport(Self);
|
||||
Report.ShowReport;
|
||||
if aShowPreview then
|
||||
Report.ShowReport;
|
||||
end;
|
||||
|
||||
procedure TlrCodeReport.SetFont(AName: string; ASize: integer;
|
||||
|
@ -57,7 +57,7 @@ begin
|
||||
with CodeReport1 do
|
||||
begin
|
||||
Report.Clear; // reset report
|
||||
CodeReport1BeginReport(CodeReport1); // execute code
|
||||
RunReport(false); // execute code
|
||||
Report.PrepareReport;
|
||||
Report.ExportTo(TfrTNPDFExportFilter, SaveDialog1.FileName);
|
||||
end;
|
||||
@ -68,7 +68,7 @@ begin
|
||||
with CodeReport1 do
|
||||
begin
|
||||
Report.Clear; // reset report
|
||||
CodeReport1BeginReport(CodeReport1); // execute code
|
||||
RunReport(false); // execute code
|
||||
Report.PrepareReport;
|
||||
Report.PrintPreparedReport('', 1); // empty string print all the pages
|
||||
// '1-5' print pages from 1 to 5
|
||||
|
Loading…
Reference in New Issue
Block a user