2002 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Muralidhar bp - pmurli problem with calculation="Sum" 2003-01-17 01:23 Hello, In the xml code which i have written.. <variable name="TotalCustomer" class="java.lang.Integer" resetType="Report" calculation="Sum"> <variableExpression> $F{CUSTOMERCOUNT} </variableExpression> </variable> This works fine when there is data in the database. When the database is empty, total is null. But I want to display as 0 ie., zero. Please help me.. Thanx Murli By: Jorge Augusto Pizzato - pizzato RE: problem with calculation="Sum" 2003-01-20 10:11 : You can use the tag < printWhenExpression > for not printing in the case of null values. <reportElement> <printWhenExpression> new Boolean($F{CUSTOMERCOUNT} != NULL) </printWhenExpression> </reportElement> Pizzato By: Teodor Danciu - teodord RE: problem with calculation="Sum" 2003-01-22 05:04 Hi, Or you could use the <initialValueExpression> : <variable name="TotalCustomer" class="java.lang.Integer" resetType="Report" calculation="Sum"> <variableExpression> $F{CUSTOMERCOUNT} </variableExpression> <initialValueExpression>new Integer(0)</initialValueExpression> </variable> Thank you, 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