insearchofsunrise Posted November 17, 2014 Share Posted November 17, 2014 Hello, 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? Link to comment Share on other sites More sharing options...
H Mendoza Posted November 17, 2014 Share Posted November 17, 2014 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. Link to comment Share on other sites More sharing options...
hozawa Posted November 17, 2014 Share Posted November 17, 2014 You've defined your field to be of type String so the value will be stored as a String. Link to comment Share on other sites More sharing options...
65644341 Posted November 27, 2014 Share Posted November 27, 2014 I've got another method by controling in java code:define this field as Stringoverride the getFieldValue(JRField paramJRField) in your relative dataSource classwhen you get the value in your java code ,you can convert them to a string. 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