Sir you skipped my original question in reply to your answer about renumbering pages...Lech Kulikowski wrote: ↑Thu Sep 27, 2018 6:38 am Hello
Ok.
Please let us know if you need any additional help.
Thank you.
Report Merging
Re: Report Merging
-
- Posts: 6459
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello,
Something like:
Something like:
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.dictionary.variables.getByName("var1").valueObject = 1;
report1.renderAsync(function () {
for (var index = 0; index < report1.renderedPages.count; ++index) {
reportMerge.renderedPages.add(report1.renderedPages.getByIndex(index));
}
});
report2.dictionary.variables.getByName("var1").valueObject = report1.renderedPages.count;
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");[code]
Thank you.
Re: Report Merging
I have tried several ways to implement your suggestion but it doesn't seem to be changing the report variable, its always a 1. Is it possible to attach a small set of example files with the Javascript code and 2 simple report files? Perhaps if I can see a full example it will make sense.
Re: Report Merging
Is it not just possible upon fully rendering to use something like this:
https://admin.stimulsoft.com/documentat ... agenumbers
I'm not sure how to use that if it is a possible solution for renumbering the page numbers on merged reports
https://admin.stimulsoft.com/documentat ... agenumbers
I'm not sure how to use that if it is a possible solution for renumbering the page numbers on merged reports
-
- Posts: 6459
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello,
Need some time to prepare a sample.
Thank you.
Need some time to prepare a sample.
Thank you.
Re: Report Merging
Okay, much appreciated.
-
- Posts: 6459
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello
Ok, we will reply in this topic when will have the sample for you.
Thank you.
Ok, we will reply in this topic when will have the sample for you.
Thank you.
Re: Report Merging
I am getting close to needing this piece quickly.
Re: Report Merging
Since this has taken nearly 2 weeks to get any type of real example on page renumbering I thought I'd share my approach. I was forced to examine this problem for hours due to upcoming deadline. Can I get confirmation that this is an acceptable solution as well?
After rendering each report into a merged report, make sure all reports you are merging have a text component named "PageNumbers" and use the following:
After rendering each report into a merged report, make sure all reports you are merging have a text component named "PageNumbers" and use the following:
Code: Select all
reportMerge.renderedPages.list.forEach(function(page,i,arr) {
var component = page.components.getByName('PageNumbers')
if(component)
component.text = 'Page ' + (i + 1) + ' of ' + reportMerge.renderedPages.count
});
-
- Posts: 6459
- Joined: Tue Mar 20, 2018 5:34 am
Re: Report Merging
Hello,
Thank you for the provided solution. Yes, this solution right.
Thank you for the provided solution. Yes, this solution right.