Dynamically change jasper class attribute textFieldExpression

I need to display a jasper textField report. The report is created in an Excel file. The problem is with a specific column that sometimes has a row and sometimes has an integer (also like a row). When it has an integer as a string, Excel complains that there is a number stored in this cell as text. I would like to display a number as a number, not as a string.

How can I dynamically change the class textFieldExpression attribute as java.lang.Integer when the string is a valid number? Or another way to insert a condition?

+4
source share
1 answer

Use two fields and PrintWhenExpression , which will determine the corresponding field to display.

+1
source

All Articles