ktrinad Posted August 30, 2006 Share Posted August 30, 2006 By: Ratchapong - jeng return "null" in String value in Variable 2003-04-15 21:32 Hi, I've problem about variable. When i leave it blank, it seem to return string "null" which cause my report not found the path that i set. How to make variable return null not "null"? in the expression of variable is somethings like this $V{path} + myReport.jasper Please help me.. Thank in advance Jeng By: Giulio Toffoli - gt78 RE: return "null" in String value in Variable 2003-04-16 00:52 When a null string is catted with another not, the result is "null". You can do something like this: ( ($V{path}==null) ? "" : $V{path}) + myReport.jasper Another way is to initilize the variable, and insert into initialExpression something like this: new String("") Goog look Giulio By: Ratchapong - jeng RE: return "null" in String value in Variable 2003-04-16 19:31 Hi Giulio, The above expression is somethings like "if-condition" ? It works like a charm, thank you Giulio. Jeng 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