Page 2 of 3

Re: Report Merging

Posted: Thu Sep 27, 2018 4:18 pm
by BCS
BCS wrote: Tue Sep 25, 2018 10:05 pm Is it possible to update the previous example with this concept, I'm still having trouble with it.
Lech Kulikowski wrote: Thu Sep 27, 2018 6:38 am Hello

Ok.
Please let us know if you need any additional help.

Thank you.
Sir you skipped my original question in reply to your answer about renumbering pages...

Re: Report Merging

Posted: Fri Sep 28, 2018 7:22 am
by Lech Kulikowski
Hello,

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

Posted: Mon Oct 01, 2018 9:45 pm
by BCS
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

Posted: Fri Oct 05, 2018 5:25 am
by BCS
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

Re: Report Merging

Posted: Mon Oct 08, 2018 12:28 pm
by Lech Kulikowski
Hello,

Need some time to prepare a sample.

Thank you.

Re: Report Merging

Posted: Mon Oct 08, 2018 10:01 pm
by BCS
Okay, much appreciated.

Re: Report Merging

Posted: Wed Oct 10, 2018 10:23 pm
by Lech Kulikowski
Hello

Ok, we will reply in this topic when will have the sample for you.

Thank you.

Re: Report Merging

Posted: Tue Oct 16, 2018 3:54 pm
by BCS
I am getting close to needing this piece quickly.

Re: Report Merging

Posted: Thu Oct 18, 2018 5:48 pm
by BCS
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:

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
            });

Re: Report Merging

Posted: Sat Oct 20, 2018 1:37 pm
by Lech Kulikowski
Hello,

Thank you for the provided solution. Yes, this solution right.