Jump to content
Changes to the Jaspersoft community edition download ×

count record according to a field value

2004 IR Help

Recommended Posts

By: Riquier - mairesse

count record according to a field value

2004-07-28 02:12

I'm new on IReport. I'm wondering how I can define a variable which count the number of field according a specific value.

I have tried to define a variable :


Variable name : CountError

Class type: java.lang.integer

Calculation type: Count

Reset type : Report

Variable expression : $F{status} == "OK" ? new integer($V{CountErreur}.intValue() + 1)

Initial value : new Integer(0)


At the compilation time I got a :


ori.jasper.engine.JRException:?Errors?were?encountered?when?compiling?report?expressions?class?file: C:TempiReport-0.3.2-srctemplatesProcListV10.java:131:?:?expected ????????????????value?=?(java.lang.Object)(((java.lang.String)field_status.getValue())?==?"OK"???new?integer(((java.lang.Integer)variable_CountErreur.getValue()).intValue()?+?1))


If somebody has a idea it will be great


PS: The software is really powerful. "Felicitation"

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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