Increment a Variable in Jaspersoft Studio

Home  >>  Jaspersoft Studio  >>  Increment a Variable in Jaspersoft Studio

Increment a Variable in Jaspersoft Studio



To Create a Increment Variable on a DataSource Field for its each occurrence, we can use the following process.

1) Assuming you have created a report with DataSource and have a Field in mind for the increment number to happen, create a Variable and rename it as intended.

2) Select the Class as String if your Field is a string, or Integer if the field is an integer. (Basically select the class of teh variable as per the class of your Field).

3) In my example, I have used Single Data Source and have used “SHIPCOUNTRY” as my field.

4) Now edit the Expression as follows.

Blog 1

5) Update the expression to new Integer if your field is an integer.

6) The Report setup and Result set of my report is as follows



This is the procedure for creating a increment variable in Jaspersoft STudio without using Scriptlet.

Leave a Reply

Your email address will not be published. Required fields are marked *