dercognus Posted August 30, 2010 Share Posted August 30, 2010 Hi all,I added some textfields to a report which contain different value. It is possible that these values are "null". I want to check if the contant is "null" and if so set the text in this textfield to a default char (say "-"). Can anybody help me how I this can be done?Thanks in advanceCognus Link to comment Share on other sites More sharing options...
cjturner Posted August 30, 2010 Share Posted August 30, 2010 Is underlying DB MySQL? You can probably do (some variant of) this in your SQL query;Select AAA, BBB, IF(target_field IS NULL, '-',target_field) as My_version, CCC from ... The 'My_version' field is the one you would use in the report. Link to comment Share on other sites More sharing options...
dercognus Posted August 30, 2010 Author Share Posted August 30, 2010 No it's no DB as data source. I use a JavaBean as datasource. Link to comment Share on other sites More sharing options...
szaharia Posted September 2, 2010 Share Posted September 2, 2010 You could use a <printWhenExpression /> for your report element. You can define 2 report elements with the same x, y, width and height, one containing the valid data, and the other exposing only the '-' character. Using their printWhenExpression you can make them visible or no in your document, depending on the "print when" condition.Hope this helps,sanda 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