Crosstab report Measure count

0

I have a simple crosstab report as below.

And I need the count of non-zero measure. i.e. if any Account has non-zero value, it is counted as 1. and counts across row are printed in the last column.

 

  Account1 Account2 Account3 NonZero Value Count
2012 32 0 45 2
2013 12 16 11 3
2014 0 0 1111 1
2015 0 0 0 0

 

I'm trying to add variables, measures however unable to figure out.

Please share any thought on how this can be achived in jasper report without using any java code.. i.e. purely in JRXML.

 

sach411's picture
Joined: Mar 26 2015 - 10:51am
Last seen: 7 months 2 weeks ago

1 Answer:

0

Try this.

create 4 varaibles v1,v2,v3,v4 of integer data type

v1 -> $F{Account1} == 0 ? 0:1

v2 -> $F{Account2} == 0 ? 0:1

v3 -> $F{Account3} == 0 ?  0:1

v4-> $V{v1}+$V{v2}+$V{v3}

create a new column label as NonZero Value Count(  - column header )and have the value as $V{v4} ( - detail band)

Let me know if you face any issue

 

 

 

 

jo.jasmine's picture
Joined: Apr 6 2015 - 8:50am
Last seen: 9 months 2 weeks ago
Feedback