Page 1 of 1

Duplicate pages and change value of a field

Posted: Tue Nov 10, 2020 2:26 pm
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

Re: Duplicate pages and change value of a field

Posted: Thu Nov 12, 2020 9:26 am
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

Re: Duplicate pages and change value of a field

Posted: Wed Nov 18, 2020 12:00 pm
by Lech Kulikowski
Hello,

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

Thank you.