Jump to content
We've recently updated our Privacy Statement, available here ×

Crosstab : "Blank if null" not works with a total average


caroline.darmon

Recommended Posts

Hello,

I have a problem with details values of crosstab, which I want blank if null.

I checked the corresponding option (blank if null) and, at this point, no problem.

But when I set the total as an average calculation, relative null values were replaced  with 0 instead of blank.

In my case, this is a real problem for understanding this report !

How could I have a blank value in this case ?

Thanks for your response

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can realize incrementer on java which return null (or your own specific object in terms of java) instead zero

http://www.jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/fill/JRExtendedIncrementer.html
http://www.jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/fill/JRExtendedIncrementerFactory.html

But...
There are few information about realization of such classes in internet and documentation
And this way not for newbies imho

I guess you have choose the easier way. For example you can calculate count not null values on column (row?) of crosstab and hide sum variable if this count = 0
see here http://www.stackoverflow.com/questions/23473887/count-number-of-rows-where-a-field-is-a-specific-value/23491357

 

Link to comment
Share on other sites

For example, this is my crosstab :

  2016-012016-022016-032016-04Average
Type 1amount3null364
 variationnullnull03 
 percentagenullnull0%100% 
Type 2amount500null250750500
 variationnullnull-250500 
 percentagenullnull-50%200% 

The data row with "average" as total calculation is print with 0 instead blank for null values :

  2016-012016-022016-032016-04Average
Type 1amount30364
 variation  03 
 percentage  0%100% 
Type 2amount5000250750500
 variation  -250500 
 percentage  -50%200% 

If the average is print with 0 for a row with blank value only, it's ok.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...