Jump to content
JasperReports Library 7.0 is now available ×

Recommended Posts

By: Roger Szeto - rszeto1

groupcount

2002-05-09 14:28

I followed the tips of counting the groups with the following code:

 

<variable name="GroupCount" class="java.lang.Integer" resetType="Group" resetGroup="MyGroup" calculation="System">

<variableExpression/>

<initialValueExpression>

($V{GroupCount} != null) ? (new Integer($V{GroupCount}.intValue() + 1)) : (new Integer(1))

</initialValueExpression>

</variable>

 

I found that if I have multiple groups, the GroupCount does not reset. It just keep growing.

Does anyone experience the same problem? Is it a bug?

 

 

By: Teodor Danciu - teodord

RE: groupcount

2002-05-10 00:06

 

Hi,

 

This is just a trick which is useful

in simple reports.

Is true that when having nested groups

the variable is not reinitialized when

a parent groups breaks.

 

But a complete control over such a counting

variable you have if you use scriptlets.

There you can increment and reset the variable

as you want.

 

Good luck!

Teodor

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