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:
jesus 2015-09-05 17:34:40 +00:00
parent bb8c94cba4
commit 8804bbadce
2 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -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