Duplicate pages and change value of a field

Stimulsoft Reports.JS discussion
Post Reply
jpgb
Posts: 67
Joined: Tue Mar 15, 2016 11:42 am

Duplicate pages and change value of a field

Post by jpgb »

I'm duplicating some pages
....
reportResult.renderedPages.clear();
numpages=report.renderedPages.count;
for (var index = 0; index < numpages; index++) {
reportResult.renderedPages.add(report.renderedPages.getByIndex(index));
}

And I wanted to change one Textfield inside the newly added pages

Is this possible?

Thanks
JB
jpgb
Posts: 67
Joined: Tue Mar 15, 2016 11:42 am

Re: Duplicate pages and change value of a field

Post by jpgb »

I´m adding the same page several times...

And i want to change a field with this code:

.....
var page = report.renderedPages.getByIndex(index);

reportResult.renderedPages.add(page)
reportResult.renderedPages.add(page)
....
const control = page.components.getByName("Text37");
if (control) control.text = "'newtext'";
reportResult.renderedPages.add(page);
....

but it changes the text field in every page added, and not only in this one...
Is there a way around?

Thanks
Lech Kulikowski
Posts: 6261
Joined: Tue Mar 20, 2018 5:34 am

Re: Duplicate pages and change value of a field

Post by Lech Kulikowski »

Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
Post Reply