Printing multiple reports in one tab
My problem is the following:
I have several different reports that I am trying to get to print in one and the same tab in my browser. I found this page on the FAQ:
https://www.fast-report.com/en/faq/18/264/
which describes a general way to do so.
In my case, the reports I am trying to merge into one are fairly different consisting of dissimilar data. So I loop through them all, filling them with their data, and then at the end I do the following code:
My problem is that after having looped through all my reports, the only one that appears on my web page is the final one - it seems the previous reports are overwritten by the next following report, one after one.
Can anyone spot a mistake I've made, or come up with another helpful suggestion?
I have several different reports that I am trying to get to print in one and the same tab in my browser. I found this page on the FAQ:
https://www.fast-report.com/en/faq/18/264/
which describes a general way to do so.
In my case, the reports I am trying to merge into one are fairly different consisting of dissimilar data. So I loop through them all, filling them with their data, and then at the end I do the following code:
                        webReport.ReportFile = GetReportPath() + result.ReportFile;
                        result.DataSetToRegister.ForEach(ds => webReport.Report.RegisterData(ds));
                        webReport.Report.Load(GetReportPath() + result.ReportFile);
                        webReport.Report.Prepare(true);
My problem is that after having looped through all my reports, the only one that appears on my web page is the final one - it seems the previous reports are overwritten by the next following report, one after one.
Can anyone spot a mistake I've made, or come up with another helpful suggestion?
Comments
I don't think you can .ForEach to RegisterData(), it will wipe and replace the prior set.
I would first try to .RegisterData(ds, ds.NAME?) so they are each named differently
But considering you are going to have different names, this will probably break your report
I think you need to combine the datasets into one first then call .RegisterData
https://stackoverflow.com/questions/1227805...e-using-c-sharp
The reports I am trying to combine have different datasets with very different values in each, so I don't think they could be combined into one dataset, at least not the way you suggest in the linked page. Does that mean it's not possible to combine the various reports into one pdf file?
you must follow the instruction in https://www.fast-report.com/en/faq/18/264/
1. with report object
a. load frx file
b. register data
c. prepare report, it will generate report and the result is called 'PreparedPages'
d. register data again
e. prepare report with append = true
2.webreport object
a.attach report object to webreport
b.webreport object is cached
c.when end user is requesting report page, report (from cache) is exported to html
you dont need webreport object here, just report object and outputted to pdf object