cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic content on the master page

former_member194198
Active Participant
0 Kudos

Hi All,

I have a simple problem. I have a master page with some header information almost all of which is fixed text. One piece of dynamic data does exist on the master page - the document number.

I've created a field in the master page which is bound to $.Agreement[].Customer[].DocumentNumber.

When the PDF is rendered in the browser, the first page has an document number as part of the header provided by the master page.

All subsequent pages have a header with the correct fixed text but the document number is blank. More strangely, when I save the PDF locally, the first document number is missing, but the one on page 2 is there.

Can anyone help populate all document numbers on all pages?

Cheers

Richard

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_m2
Contributor
0 Kudos

Dynamic content on master page is always a problem. Copy the field in design view and using scripting copy the value into the master page. This way it works. Please let me know, if you need some scripting.

Thanks,

Rakesh.

Answers (1)

Answers (1)

former_member194198
Active Participant
0 Kudos

I have resolved the issue I think.

I have added a hidden field on the main content and in the initialise script for the document number, I have filled the master page field from the main content.

This seems to run for each new page and fills correctly.

Cheers

Richard

Former Member
0 Kudos

Hi Richard,

We have a similar problem. Could you explain (incl. scripting) how you solved the issue. I have a field on the master page which should show the current profit center.

I have a table with postings sorted by profit center. Before change of profit center, I've implemented a condition page break based on profit center. That works fine.

On the master page I would like to show the current profit center based on dynamic data from table. One the first page it works but on the subsequent pages, it doesn't (i get the profit center from first page).

Thanks for any ideas,

Marcel

rakesh_m2
Contributor
0 Kudos

hello,

Please add the current profit center field in the table where you are dynamically displaying the field(In design view). Now populate that field into master page using this script.

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);

var altext;

for (var i=0; i <= fields.length-1; i++)

{

if (fields.item(i).name == "CURRENTPROFITCENTER")

{

alttext = fields.item(i).rawValue;

}

if (fields.item(i).name == "PROFITCENTER")

{

fields.item(i).rawValue = alttext;

}

}

Make sure to have variable names and field names as unique in entire form.

Thanks,

Rakesh.

former_member188019
Active Participant
0 Kudos

thanks, this helped us too.

Madhu_1980