cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a Table Header Row when Multiple Header Rows exists

0 Kudos

Hi All,

I am facing an issue in a requirement.

We have 3 header rows and then a body row, where these three header rows(with different number of fields )should always be an overflow leader to the body row.

Based on Form calc Script, I have to hide the second header row,

I have used positioned subform for header rows and table data had the above subform has overflow leader. But now I have to hide the second header row if a value in a field in that row is blank. So that the third row takes its place.

With positioned subform this hiding was not possible (since with Java script/Formcalc) it was still leaving blank space

So I created a table with three header rows and one body row and wrote the script as below in the Row2. It works fine on first page and it got hidden and there was no blank space between Row1 and Row3. But from second page onwards, the script was just hiding the text in Row2 header, but blank space  for second row is still appearing.

I have tried using formCalc as well as JavaScript

For JavaScript:

if(this.rawValue == null)

{

  this.presence = "hidden";

For FormCalc:

if ( not HasValue($))  then

     $.presence = "hidden"

endif

It is working fine in first page, hidden field is being occupied by subsequent header line.

But second page onwards it's not working as expected, field is being hidden but the space is there.

Please suggest how can I achieve this.

Thank you for your replies in advance !

Accepted Solutions (1)

Accepted Solutions (1)

prajeshdesai
Contributor
0 Kudos

Things needs to check is,

1). for feeling black space after hiding.

2). following javascript goes on all header row initialize event with your conditions.

3). Hierarchy view

4). HeaderRow Binding Tab

5). HeaderRow Pagination Tab

Worked for me.

Hope this helps.

0 Kudos

Hi Prajesh,

When we have three header rows, the check box Include Header row in Subseqeuent Pages can be selected for only one header. When we check all three, system deselects the check box on remaining two headers. Hence probably as per above screen shots, only one header went to next page.

So, I have already tried the above thing by wrapping the three header rows in a table section, and in that the selected check box "Include header rows on all pages". Rest all settings are similar to what you showed, so I get below output from second page onwards, with blank second row.

Whereas on first page, I am getting as below which is also needed from second page onwards

Please advise.

prajeshdesai
Contributor
0 Kudos

Okay, than why don't you try to change header text control dynamically, see below

Insert maximum no of HeaderRow that you want. and change headers from javascript.

Hope this helps.

0 Kudos

Even if we do what you suggest to copy the data from Row3 to Row2 using Javascript, I will have one of the rows (say the 3rd)  still remaining with blank data. We do not want blank Header row.

prajeshdesai
Contributor
0 Kudos

Will you be able to share your scenarios, like 1st header always visible, from 2nd and 3rd row only one row is visible, like that.

0 Kudos

In the First header row, there are some 8 fields which are being displayed.

In Second header row, some six fields which are being displayed.

In Third header row, some three fields which are being displayed.

Now First and Third header rows always need to be passed to all the pages if the Table data overflows.

But in Second header, say first field in it is having blank value, we need to hide the entire Second header row.

When we are hiding second row using Formcalc or Javascript, above situation arises shown in previous screen shots. First page it hides and from second page onwards, blank space comes.

Thanks for your time!

prajeshdesai
Contributor
0 Kudos

Sorry for late, finally i'm having something for you,

You need one flag variable in your interface.

Set FLAG in Code Initialization of Interface. You can define your logic for setting flag.

Make use of ALTERNATIVE, (in your form)

After creating ALTERNATIVE, drag your table in TRUE and FALSE sections, and set Alternate condition.

Now Go to layout, and drag and drop ALTERNATIVE node from Data View. Two table created on your page.

Now add header rows according your requirements. and wrap them into Section. (Select rows -> right click -> Group as Section)

and check repeat on subsequent page and initial page

Set Content type of sub-form ALTERNATIVE, TRUE and FALSE to Flowed.

Set Overflow of sub-form ALTERNATIVE to Go To Page 1.

If flag = 0 it display 1st table with two headers, else 2nd with three headers.

Hope this helps.

0 Kudos

Thanks Prajesh,

This worked .

Answers (1)

Answers (1)

0 Kudos

Hi Dolly,

as per my understanding of your requirement.

you would like to print one table with 3 header and one body. 1st and 3rd header will be visible on every page if it flow to next page but 2nd header will be visible or invisible based on some value.

while you are using 3 different header row in next page if you are hiding based on condition then some blank space are printing.

to avoid this i will suggest you to create one header row inside that create one subform inside that subform again create 3 subform for your header. now you can make 2nd subform based on your value. it it will be invisible then blank space will not print. 

0 Kudos

Hi Avinash,

I tried that too. It works similarly. First page the space is not coming, its perfect. From second page onwards blank space comes in the header.

0 Kudos

Make highlighted Subform content - flowed.

it will work.

0 Kudos

I did that only , it worked on first page only. Not from second page onwards. Issue I have been facing is from second page onwards. First page was always working fine.

Now I am trying to send the three header rows in table from the code. If I want to hide something, I won't send that row in the internal table. So I am going to handle it from the driver program now.