Jump to content
Changes to the Jaspersoft community edition download ×

Variables in Jasper Reports


Recommended Posts

By: Venkat - venkat_pasham

Variables in Jasper Reports

2005-04-11 10:12

I want to declare a variable of type "increment" and I want to increment it based on a group. I am using Ireport and I didn't find a way to specify this.

 

So, I declared like this in my XML file:

 

<variable name="flip" class="java.lang.Integer" resetType="Report" incrementType="Group" incrementGroup="Split">

<variableExpression><![CDATA[$F{PRODUCT_DELTA_ID}]]></variableExpression>

<initialValueExpression><![CDATA[new Integer(0)]]></initialValueExpression>

</variable>

 

When I execute Jasper Compile command this is the error I got :

 

net.sf.jasperreports.engine.JRException: Attribute "incrementType" must be declared for element type "variable".

 

Can someone please tell me the right way to do this,

 

Thanks

Venkat

 

 

By: jorge - sirion_oef

RE: Variables in Jasper Reports

2005-04-16 16:54

a recomendation, if you gonna use ireport don't modify directly the file if you dont know xml and jasper syntax, ireport does this for you.

 

what kind of data is $F{PRODUCT_DELTA_ID} ?

 

if it is String use = new Integer($F{PRODUCT_DELTA_ID} )

 

if it is Float use = new Integer($F{PRODUCT_DELTA_ID} .IntValue())

 

 

if the var is reset every start of a group use = resetType="Group"

 

 

you can see the examples that comes with the zip. they are very useful

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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