sreepriyar Posted May 8, 2007 Share Posted May 8, 2007 Hi all, I have a particular field which if it has some value, I should create a new column and display the details in that. If it does not contain the details, I should not display the column. Is there any way to handle this in Jasper report? Lets say I have 2 columns in my report. (field1 and field2) IF (field1.equals(showme), thencreate a new column(field3) and display field1details,else proceed in same manner. case 1: field1!=showmedisplay Field1 Field2case 2 : field1==showmedisplay Field1 Field3 Field2 Can I do this? Link to comment Share on other sites More sharing options...
sreepriyar Posted May 9, 2007 Author Share Posted May 9, 2007 Any Help will be appreciated Link to comment Share on other sites More sharing options...
chill_work Posted May 9, 2007 Share Posted May 9, 2007 As I understand it, you need the column to change based on data you are getting from some datasource (database, javabean, etc.). I wouldn't make the column field static. Just make it a regular textField. In the textFieldExpression you can add your condition (I am assuming it is a string). Code:$F{someDataField}.equalsIgnoreCase( "data" ) ? "Column Text": "" You might have to play with this to get the formatting to work out right on your report; especially if other columns might be position the same way. Calvin 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