Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Saturday, September 1, 2012

A Crosstab Counter in Jaspersoft iReport Designer

This video shows how to number the rows in a Jasper Reports crosstab.  A custom Java class 'Counter' is used in a Text Expression.  The expression retrieves the current value and increments the counter.

Developing a class in the Eclipse IDE for use in iReport Designer is also featured.

The code referenced in the video is available here.  It's compiled using Java 6 into a JAR file here which is ready to use in iReport Designer 4.7.0.


  1. Check out the custom Java-free version here: http://bekwam.blogspot.com/2012/09/the-improved-crosstab-counter-in.html.

    1. I have did as in this video all went good but when i complied it

       Compiling to file... /root/Desktop/ARTI/Stockupload.jasper
      net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :       1. Crosstab bucket expression missing for group order.      2. Crosstab bucket value class missing for group order.     at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:258)     at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:140)     at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:215)     at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:131)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:514)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

      pls help me

  2. Thanks u.....................

    pls give me idea how to sum row group field

  3. Hi Carl,

    I have did as in this video all went good. But I have a problem , these counter number is not resetting. please help me to solve this issue.

    I need to reset counter for each and every hit.

    1. Hi,

      How are you calling the report? Is it through a web app or through iReport?

    2. Hi Carl,

      I have also same problem i am calling it iReport Designer 5.0.0 so kindly tell me how to reset counter every time