JasperReports – Line Numbers

Problem: When using rowNumber, line numbers are starting at 0. How to start them with 1?

Solution:

This starts line number with Zero (0)

<variableExpression><![CDATA[new Integer($V{rowNumber}.intValue()+1)]]></variableExpression>

This starts line number with One (1)

<variableExpression><![CDATA[new Integer($V{REPORT_COUNT}.intValue()+1)]]></variableExpression>

-o-

Advertisements

One thought on “JasperReports – Line Numbers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s