Monday, July 30, 2012

Hiding Columns in Jasper Reports

A common request for reports is to select which columns to display in the report, but there's no clear way on how to have the horizontal space shrink when less columns are shown. Let me rephrase, there is a clear way to do it, but it's just not well known. Here is a great example that I came across that helped me out.

In a nutshell all you're doing is using a table and putting a showExpression on the column itself.

Note: I came across a little gotcha with the first row of the table not showing up. Looks like passing the master report's data source to the sub report is a bad idea. Here is why

No comments:

Post a Comment