jasper reports - Dynamic row counter -


i'm trying create dynamic row number in ireport
there way create variable changes according following rules:

-increments according row number

-stops incrementing if field of type (e.g. xxx in example below)

i.e.
------------------
s/n  fieldtype  amount  cost
------------------
1     zzz           123         $34
2     yyy           111         $85
2     xxx           222         $24
3     yyy           111         $66
4     zzz           222         $75
5     zzz           555         $35
5     xxx           111         $14
6     zzz           888         $21

this can group xxx part of record before it.

yes, possible this. create new variable , change class integer. keep default values resettype, incrementtype, , calculation; "report", "none", , "nothing", respectively.

set initialvalueexpression "1" (or whatever want first id be).

set variableexpression to:

$f{fieldtype}.equals("xxx") ? $v{customid} : $v{customid} + 1 

where customid name of new variable.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -