cancel
Showing results for 
Search instead for 
Did you mean: 

header of page, dependent on table row values

NoJo
Active Participant
0 Kudos

Hi,

I'm using conditional breaks, works fine. (for example all rows with "A" in the first column on one page, with "B"" on the second and third page, and so on)

But I want to change a Header field dependent on a value of the first VISIBLE row of each page:

if I am on the first page with the "A" ("A" rows are visible) --> Field X in the Header shuold be "ANGRY"

if I am on the pages with the "B" ("B" rows are visible)--> Field X in the Header shuold be "BETTER"....

if I am on the first page with the "B" ("A" rows areNOT visible) --> Field X in the Header shuold be "BETTER"

thanks in advance!

norbert

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Check the following thread for looping over a table -->

Then as specified in the thread in the "for" loop of Table write an "if" condition for the 1st column to check whether it is "A" or "B".

if ( xfa.resolveNode("data.tablesubform.table1.row["+i+"].column1").rawValue == "A" )
{
      HeaderField.rawValue = "ANGRY";
}
else if ( xfa.resolveNode("data.tablesubform.table1.row["+i+"].column1").rawValue == "B" )
{
    HeaderField.rawValue = "BETTER";
}

I have not checked this but see if it helps.

Chintan

NoJo
Active Participant
0 Kudos

Whats the best event for placing such a script?

is there an event thath is triggered at page breaks?

whe i do the "for" loop, how do i know " i" of the first row of this page?

br norbert

chintan_virani
Active Contributor
0 Kudos

I am not sure if there is a event for page breaks but try placing the script in form:ready or layout:ready events of the main top level subform.

Chintan

Answers (2)

Answers (2)

OttoGold
Active Contributor
0 Kudos

Did you try to get the page number of the each "first-on-page" row and manipulate your header from here? I guess you know how to script page numbers/ get the page no for the form element. Otto

NoJo
Active Participant
0 Kudos

done

chintan_virani
Active Contributor
0 Kudos

Please close you threads with proper solution instead on one word comments such as "done"

This will ensure that we have threads with proper responses and people looking for same issue would benefit.

Chintan