Java – dynamically change the class attribute of Jasper’s textfieldexpression

I have to display a jasper report in textfield The report is generated as an excel file The problem is in a particular column, sometimes a string, sometimes an integer (also as a string) When it has an integer as a string, excel complains that there is a number stored in text in that particular cell I want to display numbers as numbers, not strings

How to dynamically change the class attribute of textfieldexpression to Java when the string is a valid number lang.Integer? Or another way to insert conditions?

Solution

Use two fields and a printwhenexpression to determine the corresponding field to display

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>