Hide column in table by use of property

I have a table were I want to hide some of the columns by default, but the user should be able to choose to show the columns.

I would like to do this without the use of inout controls. Is that possible?

If I use the print when expression = Boolean.FALSE on a column, this column is hidden in the report. The column is listed under Show columns when I run the report, but nothing happens when I click it. Is there a property I can set on the column so that the column is not visible by default, but in the table the user can click to show the column?

ebz's picture
ebz
68
Joined: Jan 7 2016 - 3:14am
Last seen: 6 years 1 month ago

I checked it on jasperserver 6.1 and it works perfectly even make the change on studio by using print when expression. Showing hidden column by selecting from 'Show columns'  is valid and working. What jasperserver version are you using?

zh3ntil - 7 years 8 months ago

I finally got it working with the print when expression. I had grouped some of the columns together, so after removing the column groups the hiding/showing of columns worked fine.

ebz - 7 years 8 months ago

2 Answers:

Are you using the Table component to create your table?

Following wiki has some information about viewing reports with  a Table component on JasperReports Server.

http://community.jaspersoft.com/wiki/how-disable-table-sortingfiltering-...

hozawa's picture
190289
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago

Thans for the reply.

I would like to have sorting and filtering on my table, so I can't set  net.sf.jasperreports.components.table.interactive = false.

I would instead add a property to a column where I say something like visible = false, and then the column is hidden by default in the report, but the user can click on a column in table and see the hidden column in the "Show columns" list. The problem is that I havn't found any property to use for this? Is it possible?

ebz's picture
ebz
68
Joined: Jan 7 2016 - 3:14am
Last seen: 6 years 1 month ago
Feedback
randomness