Hi,
I have a Jasper report template, and I need to show/hide a column at runtime based on a particular condition. I'm using "Print when expression" to conditionally show/hide this column (and it's header) in my report. When the column is hidden, the space it would have occupied is left blank, which is not particularly attractive.
I would prefer if the extra space was used in a more effective manner, possibilities include:
- the width of the report is reduced by the width of the hidden column
- the extra space is distributed among the remaining columns
In theory, I could achieve (1) by setting the width of the column (and header) to 0, but also indicate that the column should resize to fit it's contents. But AFAIK Jasper does not actually provide a "resize width to fit contents" option.
Another option is to generate my reports using the Jasper API instead of defining the report template in XML. But that seems like a lot of effort for such a simple requirement.
Thanks in advance, Don