One field with different types?
Posted on November 17, 2014 at 8:07am
i have field
<field name="value" class="java.lang.String"/>
It may contains four kinds of data: Date, Boolean, Number, String
How to display it? There is always problem with cast. How tell Jasper to recognize proper type depends of value data?
Posted on November 17, 2014 at 10:38am
Hi there - Have you considered using the Java methods that are available from the Expression Editor? Those methods are powerful and will help you manage your data fields. Let me know.
Posted on November 17, 2014 at 12:03pm
You've defined your field to be of type String so the value will be stored as a String.
Posted on November 26, 2014 at 6:53pm
I've got another method by controling in java code:
define this field as String
override the getFieldValue(JRField paramJRField) in your relative dataSource class
when you get the value in your java code ,you can convert them to a string.