anjumprevaiz Posted January 27, 2009 Share Posted January 27, 2009 hi buddies can i use if else in ireportsif(conditon){statement....satatement....statement.....}else if(condition){statement....satatement....statement.....}else{} like that Link to comment Share on other sites More sharing options...
svenn Posted January 27, 2009 Share Posted January 27, 2009 You can do this in a sciptlet. You can also do a form of this in an expression though a big if else statement can get messy.Your approach will depend partly on what you're trying to do with your conditional statement. Link to comment Share on other sites More sharing options...
jimjohn Posted January 29, 2009 Share Posted January 29, 2009 Hiii As per my knowledge we cannot use if else in ireport.But you can achive the same result by using formulas( <condition> ? exp1 : exp2 )it is equalent toif(condion){exp1}else{exp2}Further questions pls feel free to contact .Next time give with example.Thanks jim Link to comment Share on other sites More sharing options...
veerchinta Posted June 5, 2009 Share Posted June 5, 2009 could you tell me wats wrong with the following... (!$F{RECPT_ID}.equals("0")) ? $V{Fname} = $F{FIRST} + "*" : $V{Fname} = $F{FIRST} Link to comment Share on other sites More sharing options...
svenn Posted June 5, 2009 Share Posted June 5, 2009 You can not assign a value to a variable using conditional logic using that syntax.What are you trying to do? Link to comment Share on other sites More sharing options...
veerchinta Posted June 5, 2009 Share Posted June 5, 2009 i need to display the first name concatenated with "*" if the recpt_id =0. and as well change the background color for that record. Link to comment Share on other sites More sharing options...
eusened Posted September 28, 2009 Share Posted September 28, 2009 ( $V{sumValueForLess} == null ? new java.lang.Double(0.00) : $V{sumValueForLess} ) Type mismatch: cannot convert from Double to boolean. What should I do? Link to comment Share on other sites More sharing options...
ayazpasha2434 Posted May 6, 2011 Share Posted May 6, 2011 May be you can try this, not sure though.Code: $V{Fname} = (!$F{options.equals("0")}) ? $V{FIRST} +"*" : $V{FIRST} Link to comment Share on other sites More sharing options...
vsemwal Posted May 24, 2011 Share Posted May 24, 2011 How to use if else in Jasper Report?Many times we have some parameter whose value we calculate based on other.I stuck on problemae i had two parameter P_BID_STATUS_FLAG and P_BID_STATUS_FLAGif P_BID_STATUS_FLAG='W'P_BID_STATUS_FLAG="wait"else if P_BID_STATUS_FLAG='R'P_BID_STATUS_FLAG="run"now converting it into jasper Code: Post Edited by vsemwal at 05/24/2011 12:19 Link to comment Share on other sites More sharing options...
ayazpasha2434 Posted May 24, 2011 Share Posted May 24, 2011 "i had two parameter P_BID_STATUS_FLAG and P_BID_STATUS_FLAG"Do you have 2 parameters by same name? We can't have 2 parameters by same name(atleast not in the latest version 4.0.2).The expression seems fine though. By the way, what is your actual problem? Link to comment Share on other sites More sharing options...
farevi5 Posted February 1, 2013 Share Posted February 1, 2013 Yes, you can WE CAN use IF- ELSE statement but we must to change the language of our report to javascript by default is Groovy. (Properties panel - Language) XD. 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