User can use “Column Print When” expression to conditionally display and suppress column display in a report table. Users need to manually type in the expression using the information from report main structure (as highlighted in orange in the screen shot below). Fields from Sub Dataset structure (as highlighted in black) cannot be used in “Column Print When” expression.
(click on the image for a larger version)
The enclosed demo report will show how “password” column is displayed only when report executor is a “superuser”. User can download the demo report unit zip file and import it into JasperReports Server v5.5. The report is deployed under /public/Samples/Reports/ repository folder as “201._Sample_Report_with_Table_Column_Conditional_Display”. Users can run this report under superuser and non superuser to see the difference in its display. Users can also review the report design using iReport Designer Repository Navigator and/or Jasper Studio Jasperserver Explorer.