Merging reports doesn't work with custom preview?

edited August 2019 in FastReport VCL
Hi,

I have this code that merges reports as found here on the forum:

frxReport.LoadFromFile...
frxReport.PrepareReport(False);
frxReport.LoadFromFile...
frxReport.PrepareReport(False);
frxReport.LoadFromFile...
frxReport.PrepareReport(False);
frxReport.ShowPreparedReport;

It works when I preview the report as long as there's no custom previewer assigned. When you assign a Preview component, the report is immediately displayed when you call PrepareReport and cleared for additional reports.

This seems like a bug.

I did find a workaround though, assigning the previewer in code after preparing the reports.

With regards,

Martijn Tonies

Comments

  • Hello,

    Thats seems a bug. I've put it to our BUG tracker.

    As a temprary solution you can reset preview and set it after preparing.

    Like:


    frxReport.Preview := nil;

    frxReport.LoadFromFile...

    frxReport.PrepareReport(False);

    frxReport.LoadFromFile...

    frxReport.PrepareReport(False);

    frxReport.LoadFromFile...

    frxReport.PrepareReport(False);

    frxReport1.Preview := frxPreview1;

Leave a Comment