How to refresh composite reports?
I have a composite report containing three reports which I preview in a custom preview form. It is created with frxReport.PrepareReport setting ClearOldRpt to True for the first report and false for the next two. This displays correctly with all three reports showing on the preview however if I print or export the report it disappears from the preview screen. The report is still there somewhere since I can scroll through the pages and although the preview screen is blank the page size changes as it goes to portrait or landscape pages and if I print again I get all pages from all reports printed.
How can I refresh the preview so it is visible again? frxPreview.Refresh does nothing and frxPreview.RefreshReport deletes the first two reports and displays the third. Closing the preview form and reopening it with frxReport.ShowPreparedReport just shows a blank preview form as well.
How can I refresh the preview so it is visible again? frxPreview.Refresh does nothing and frxPreview.RefreshReport deletes the first two reports and displays the third. Closing the preview form and reopening it with frxReport.ShowPreparedReport just shows a blank preview form as well.
Comments
frxReport1.PrepareReport(True);
frxReport1.PrepareReport(False);
frxReport1.PrepareReport(False);
frxReport1.Preview := frxPreview1;
frxReport1.ShowPreparedReport;
I have a similar issue trying to print one page from a prepared composite report. The only solution I can get working is to delete all the other pages, print the page left, then recreate the whole report again unless somebody can tell me I have missed some option somewhere.
frxReport1.Print;
frxPreview1.UnLock;
or
frxReport1.PreviewPages.Print;
Many thanks for that - works perfectly and feels a much better solution than recreating the report.
Is there a way to print one page from the report and keep the whole report available for preview? At the moment I delete all the pages except the one in view, print the remaining report (ie one page)then recreate the report which does not feel at all like a good solution other than it works.
procedure TPrintPreviewFm.BtnPrintPageClick(Sender: TObject);
begin
frxPreview.Lock;
MainView.frxReport.PrintOptions.PageNumbers := IntToStr(frxPreview.PageNo);
if YNPrint.Ticked then MainView.frxReport.Print;
if YNpdf.Ticked then MainView.frxReport.Export(frxPDFexport);
frxPreview.Unlock;
end;
This procedure is on the preview form. frxReport and frxPDFexport and the code for frxUserDataSet1GetValue are on the main form (MainView) because they are accessed from several different places (not just the preview form). I have also tried hard coding the page as '3', and frxPreview.Print. The user will not know which single page they want until after looking at the preview since the program is a complex monte carlo simulation and they need to look at the output to see if they want it all or just some of it. The preview is a composite report made up from 2, 3 or 4 separate reports.