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

0

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

caroline.darmon's picture
Joined: Nov 25 2016 - 2:27am
Last seen: 3 years 1 month ago

For example, this is my crosstab :

    2016-01 2016-02 2016-03 2016-04 Average
Type 1 amount 3 null 3 6 4
  variation null null 0 3  
  percentage null null 0% 100%  
Type 2 amount 500 null 250 750 500
  variation null null -250 500  
  percentage null null -50% 200%  

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

    2016-01 2016-02 2016-03 2016-04 Average
Type 1 amount 3 0 3 6 4
  variation     0 3  
  percentage     0% 100%  
Type 2 amount 500 0 250 750 500
  variation     -250 500  
  percentage     -50% 200%  

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

caroline.darmon - 3 years 1 month ago

2 Answers:

-1

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...
http://www.jasperreports.sourceforge.net/api/net/sf/jasperreports/engine...

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-whe...

 

sanbez's picture
832
Joined: Jan 11 2011 - 2:06am
Last seen: 12 hours 26 min ago
0

Thanks Sanbez for your answer,

This is interesting, but my problem is not on the total column but with the print of 0 in detail cell in case of null value (see the my comment above).

Is it possible to print blank instead of 0 ?

caroline.darmon's picture
Joined: Nov 25 2016 - 2:27am
Last seen: 3 years 1 month ago
Feedback
randomness