This question already has an answer here:
- How to show/hide a column at runtime? 8 answers
I am using ireport to design jasper reports. I want to have a report that can be dynamically generated based on user input. Means columns can be added/removed based on user input.
The one solution I know is to design the report that contains all the columns, Then based on the user input, Using "Print When Expression" can hide the column, But the empty column will still be there. Is there any way to remove the columns completely without leaving empty space in ireport.
JasperDesign is used to modify the template object (JasperReport) from within the code at runtime. I guess this might fit in your case.
Also check this SO question