sbenbli Posted June 19, 2007 Share Posted June 19, 2007 new Boolean($F{yesno}.intValue()==0) (expression of variable)why it's not true in a variable to make account, a count is falsebut there are not some error Link to comment Share on other sites More sharing options...
mar_ass Posted June 19, 2007 Share Posted June 19, 2007 I guess you could try to write your $F{yesno} value somewhere to be sure that it's value is 1 or 0. Assuming, you have groups in your report try doing as follows: Variable - testVariable class - java.lang.IntegerCalculation type - SystemReset type - groupInitial Value Expression:($V{test} != null) ? ($F{yesno}.intValue() == 0) ? (new Integer($V{test}.intValue() + 1)) : (new Integer($V{test})) : (new Integer(1)) Link to comment Share on other sites More sharing options...
sbenbli Posted June 19, 2007 Author Share Posted June 19, 2007 it sign error why net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The constructor Integer(Integer) is undefined value = (java.lang.Integer)((((((java.lang.Long)field_yesno.getValue()).intValue() == 0)?(new Integer(((java.lang.Integer)variable_nbraudela.getValue()).intValue() + 1)):(new Integer(((java.lang.Integer)variable_nbraudela.getValue()))))));/*$JR_EXPR_ID=17$*/ <---------------------------------------------------------------> 2. The constructor Integer(Integer) is undefined value = (java.lang.Integer)((((((java.lang.Long)field_yesno.getOldValue()).intValue() == 0)?(new Integer(((java.lang.Integer)variable_nbraudela.getOldValue()).intValue() + 1)):(new Integer(((java.lang.Integer)variable_nbraudela.getOldValue()))))));/*$JR_EXPR_ID=17$*/ <------------------------------------------------------------------> 3. The constructor Integer(Integer) is undefined value = (java.lang.Integer)((((((java.lang.Long)field_yesno.getValue()).intValue() == 0)?(new Integer(((java.lang.Integer)variable_nbraudela.getEstimatedValue()).intValue() + 1)):(new Integer(((java.lang.Integer)variable_nbraudela.getEstimatedValue()))))));/*$JR_EXPR_ID=17$*/ <------------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:578) at java.lang.Thread.run(Unknown Source) thank you Link to comment Share on other sites More sharing options...
mar_ass Posted June 19, 2007 Share Posted June 19, 2007 ($V{test} != null) ? ($F{yesno}.intValue() == 0) ? (new Integer($V{test}.intValue() + 1)) : (new Integer($V{test}.intValue())) : (new Integer(1)) Link to comment Share on other sites More sharing options...
sbenbli Posted June 20, 2007 Author Share Posted June 20, 2007 the account is not good,I want to know how much has 0 and how much there is 1 in every group, this formula makes increment thank you very much Link to comment Share on other sites More sharing options...
sbenbli Posted June 20, 2007 Author Share Posted June 20, 2007 Post edited by: sbenbli, at: 2007/06/20 08:49 Link to comment Share on other sites More sharing options...
mar_ass Posted June 20, 2007 Share Posted June 20, 2007 Ohhh, I thought that you want to increment your variable if field number is equal to 1 :/ My bad, sorry. So I guess you should make two variables than, the same way :) Variable #1 = YesCnt ($V{YesCnt} != null) ? ($F{yesno}.intValue() == 1) ? (new Integer($V{YesCnt}.intValue() + 1)) : (new Integer($V{YesCnt}.intValue())) : (new Integer(1)) Variable #2 = NoCnt($V{NoCnt} != null) ? ($F{yesno}.intValue() == 0) ? (new Integer($V{NoCnt}.intValue() + 1)) : (new Integer($V{NoCnt}.intValue())) : (new Integer(1)) Try this and let me know if it fulfills your needs :) Link to comment Share on other sites More sharing options...
sbenbli Posted June 20, 2007 Author Share Posted June 20, 2007 no idea for this topic?tank you for help Link to comment Share on other sites More sharing options...
mar_ass Posted June 21, 2007 Share Posted June 21, 2007 So, you're saying that I didn't understand your needs ? If you say that you need to know how many 1s and 0s there are within each group, than imho you need to make two variables as I described in previous topic. Link to comment Share on other sites More sharing options...
sbenbli Posted June 21, 2007 Author Share Posted June 21, 2007 thank you mar_ass I found the solution, I make the sum of all the column $F{yesno} and since it's composed of 0 and 1 it's going to make the sum of 1 and has that is then the accountthe account of 0 I make the total of this $F{yesno}-count of 1 and here is the account is goodis a logic ! thank you another time:woohoo: 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