Four Js Development Tools Forum

Discussions by product => Reporting tools (GRW, GRE) => Topic started by: Jeff M. on April 07, 2022, 01:40:31 pm



Title: Hiding Columns in a Table
Post by: Jeff M. on April 07, 2022, 01:40:31 pm
I've tried to hide columns in a table in 3.20 Genero Report write by entering criteria into 'Visibility Condition' in ColDef (also tried in header and body and mix of them all).

When you run the report you get the error:

Processor error:
com.fourjs.report.shared.DocumentStructureException: (GS-33019) COL references undeclared column in COLDEFS section

Can you not hide columns and if not, why does ColDef have a visibility condition? If you can, how?

I can hide the data in the column  but not the column itself.

Thanks


Title: Re: Hiding Columns in a Table
Post by: Alex G. on April 07, 2022, 02:19:30 pm
Hi Jeff,

In version 4.0 you set the visibility condition on the COLDEF and that will hide or show the specified column (The issue for this is GRE-598).

>Can you not hide columns and if not, why does ColDef have a visibility condition? If you can, how?

I didn't check but I think that that was also possible in version 3.20 but you had to take care of hiding/showing both the COLDEF as well as the COL objects and you had to recompute colspan values in case that you were removing a column that is spanned by some row.
In other words, you have to make sure that the table structure stays valid so that the number of COLDEFS and the COL objects in all rows match (note that there can be less COL object on rows where COL objects have colspan set).

Best regards,
Alex



Title: Re: Hiding Columns in a Table
Post by: Gary C. on April 07, 2022, 02:21:59 pm
I have come across this a few times (we are on 3.20) and have found that adding the same visibility condition to the column object in all elements works: the Coldefs, Header and Body.

Whether this is best practice, I don't know!

Gary



Title: Re: Hiding Columns in a Table
Post by: Alex G. on April 07, 2022, 02:31:29 pm
Hi Gary,

Thanks for the clear description.

>Whether this is best practice, I don't know!

Absolutely, COLDEFS and COL/colspan numbers need to match for things to work correctly. In version 4.0 things are taken care of so that a visibility condition for a specific column need to be specified in one place only where the column is defined (COLDEF).

Best regards,
Alex


Title: Re: Hiding Columns in a Table
Post by: Jeff M. on April 07, 2022, 03:59:16 pm
Thanks everyone.

This has worked: I had tried before but I think I had set one or two of the visibility conditions on the field itself rather than the column with some imprecise clicking in the report structure tree which led to the error.