Dynamically change the class attribute of jasper's textFieldExpression
I have to display a textField
a jasper report. The report is generated to an Excel file. The problem is with a particular column which sometimes has a string and sometimes has an integer (开发者_开发问答also as string). When it has an integer as string, Excel complains that there is a number stored as text in that particular cell. I would like to display the number as a number, not as a string.
How can I dynamically change the class
attribute of the textFieldExpression
to be java.lang.Integer
when the string is a valid number?
Or is another other way to insert a condition?
Use two fields and a PrintWhenExpression
that will determine the appropriate field to display.
精彩评论