cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hiding a Table Header Row when Multiple Header Rows exists

0 Likes
4,341

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 !

View Entire Topic
prajeshdesai
Contributor
0 Likes

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 Likes

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 Likes

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 Likes

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 Likes

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 Likes

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 Likes

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 Likes

Thanks Prajesh,

This worked .