Report Merging
Report Merging
Is it possible to merge or append different reports together as in different (*.mrt) files. I know one can make different pages in one report but the scope of my requirements require me to obtain external documents or agreements or other analytics reports which I can template but each end product will be different and may or may not use all pages.
My guess was probably to gain access to the page collection before rendering but I'm at a lose how to proceed from there if its even possible.
I am using Stimulsoft Reports.JS
My guess was probably to gain access to the page collection before rendering but I'm at a lose how to proceed from there if its even possible.
I am using Stimulsoft Reports.JS
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello,
You can use the following code:
Thank you.
You can use the following code:
Code: Select all
var report1 = new Stimulsoft.Report.StiReport();
report1.loadFile("Reports/1.mrt");
var report2 = new Stimulsoft.Report.StiReport();
report2.loadFile("Reports/2.mrt");
var reportMerge = new Stimulsoft.Report.StiReport();
reportMerge.reportUnit = report1.reportUnit;
reportMerge.render();
reportMerge.renderedPages.clear();
report1.renderAsync(function () {
for (var index = 0; index < report1.renderedPages.count; ++index) {
reportMerge.renderedPages.add(report1.renderedPages.getByIndex(index));
}
});
report2.renderAsync(function () {
for (var index = 0; index < report2.renderedPages.count; ++index) {
reportMerge.renderedPages.add(report2.renderedPages.getByIndex(index));
}
});
viewer.report = reportMerge;
viewer.renderHtml("viewerCont");
Re: Report Merging
Okay thank you I will give it a try and let you know.
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
Re: Report Merging
I do have an additional question, how does one reset the page numbering so that the page numbering is contiguous and not 1 of 4 then for the next report 1 of 7 for instance instead of 1 of 11?
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello,
You can try to use an additional variable for page numbering. After first report rendering set the count of pages to that variable and provide it in the second report.
Thank you.
You can try to use an additional variable for page numbering. After first report rendering set the count of pages to that variable and provide it in the second report.
Thank you.
Re: Report Merging
Is it possible to update the previous example with this concept, I'm still having trouble with it.
Re: Report Merging
I am also having an issue where sometimes it will not render the report with renderAsync, i have to refresh the page to make it work properly. Is there a way to know when the report is done rendering?
Re: Report Merging
I think I solved this issue by making each report be "reportX.isAsych = true"
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello
Ok.
Please let us know if you need any additional help.
Thank you.
Ok.
Please let us know if you need any additional help.
Thank you.