2005 IR Help Posted August 27, 2006 Share Posted August 27, 2006 By: kler44 - kler44 printWhenGroupChanges 2004-10-28 02:42 I need to print a value only once, when the group changes. This is my code : <textField isBlankWhenNull="true" evaluationTime="Group" evaluationGroup="ThemeGroup"> <reportElement x="190" y="1" width="60" height="22" printWhenGroupChanges="ThemeGroup" isPrintRepeatedValues="false"/> <textElement textAlignment="Left" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.Integer">$V{nbThemes} </textFieldExpression> </textField> The problem is that the value is always repeated. Can you tell me what is the problem and how I can resolve it ? Thank you. By: Tobias Gaekle - ike987 RE: printWhenGroupChanges 2004-10-29 01:56 there is no condition whether the value should be printed or not, so it always prints. you could define a variable like this: <variable name="showOnce" class="java.lang.Integer"> <variableExpression><![CDATA[ $V{ThemeGroup_COUNT}.intValue() == 1 ? $V{nbThemes} : null ]]></variableExpression> </variable> the groupname_COUNT holds the number of already processed records for that group. if it holds 1, return nbThemes, else return null. hth 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