hide column if values null

Good day,

How to hide a column if its values are null? (in my case the table will have only one row)

Very much thanks; the question is short but it would be a major breakthrough for me..


sledgeas's picture
Joined: May 5 2008 - 12:18am
Last seen: 15 years 5 months ago

3 Answers:

This tutorial explains exactly how: https://www.youtube.com/watch?v=Bmrqo9fDkOs

kkumlien's picture
Joined: Jan 22 2015 - 4:36am
Last seen: 7 months 6 days ago

Check box is there when you use the fields as drag to report to display.

So there is a check box  "blank when null"  you check there it can easily avoid the blank column


prasad_psl's picture
Joined: Sep 16 2008 - 6:52am
Last seen: 15 years 2 weeks ago

Thanks. But the problem is that I need to shift to the left all columns which are to the right of this hidden one.. Provided there might be some hidden columns among them too (recursion)


Thanks huge, if we break this through


sledgeas - 14 years 11 months ago
Anyone?.. Please, this is a major breakthrough in the project..
sledgeas - 14 years 11 months ago
If I solve this issue, our whole company staff (20 ppl) would be trained and using iReport!
sledgeas - 14 years 11 months ago

If the columns are all the same datatype and format, this is what I would do.

First, you will need a Scriptlet class.

Second, create report variables for every column. Let's say x1 .. xn. (It might be possible to use an array or Vector here, I'm just sketching out an idea.)

Third, bind the report fields to the variables instead of the database fields.

Fourth, use the scriptlet to assign the variables as each row is evaluated: x1 gets first non-null database field, x2 gets second, etc. You can do this in a clean loop if you use arrays or vectors in a sensible way.

drlaz's picture
Joined: Aug 31 2007 - 5:13am
Last seen: 16 years 1 month ago
Was there any other solution than the Scriptlet? I, too, have a need for dynamic column presentation where all the columns to the right are scooted to the left when a column isn't printed...?
deloreanguy - 13 years 3 weeks ago

I find it truly incredible that questions like this get no answer even after 10 years, if a reporting tool is designed to create reports how it can possibly be trusted when deadlines are tight, and the work needs to be delivered.


If this functionality is not easily accessible “by default” then there is no point in deploying or even wasting time in training people in the use of Jasper Reports.


Then there is the support aspect, every problem I have encountered and there are many trust me, I have had to solve with trial and error. It looks like many others here have simply left this forum and started using other tools because of the lack of creditability of Jasper Studio and reports.




jasperjones999 - 5 years 7 months ago