cancel
Showing results for 
Search instead for 
Did you mean: 

Get a first Value of the Table on the Page to display on header

rajiv_kanoria
Explorer
0 Kudos

I have below data

POSCODE      DESC       QUAN

1                         A               10

1                         A               20

2                         B                 34

2                         B                    42

2                         B                    43

Now the Table above has a conditional Break when the poscode changes. Now Posode 1 will appear on page 1 and Pocode 2 will appear on Page 2.

Now requirement is  that I need the print the POSCODE which appears in the table on the specific page , the value should be printed on the Header which exist on the page.

Please help me on this.

Regards,

Rajiv

Accepted Solutions (0)

Answers (1)

Answers (1)

pavan_prabhu
Active Participant
0 Kudos

Hello Rajiv,

     Click on the Header field where you want to print the Poscode value. Write the below JavaScript code in the Ready Layout event of this field.

var currpage = xfa.layout.page(this);

var fields = 0;

fields = xfa.layout.pageContent(currpage-1, "field", 0);

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

     {

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

// ---- Here I have considered the table field name as POSCODE. Change the field name if it is different in your case.

                 {

                      this.rawValue = fields.item(i).rawValue;

                 }

     }