2001 JI Open Discussion Posted August 14, 2006 Share Posted August 14, 2006 By: Roger Szeto - rszeto1 groupcount 2002-05-09 14:28I 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now