nkrowe Posted March 12, 2015 Share Posted March 12, 2015 This is my expression in the expression editor: $F{classes_class_begin_date} + " -- " + $F{classes_class_end_date}Both classes_class_begin_date and classes_class_end_date are class java.sql.TimestampWhen I run the report, I get the error: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression.Either field works ok alone but when I combine them (as above) I get the error. An I combining the wrong??? Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted March 13, 2015 Share Posted March 13, 2015 If your data is coming from query can you modify your query like thisTo_Char(start_date,'dd.MM.yyyy') || ' - ' START_DATE , To_CHAR(end_date,'dd.MM.yyyy') END_DATEHere "-" this is appended to the Start _DATE Link to comment Share on other sites More sharing options...
nkrowe Posted March 13, 2015 Author Share Posted March 13, 2015 I finally got it to work by adding some format to the expression. Here is the result:new java.text.SimpleDateFormat("EEE, d MMM yyyy, hh:mm aa").format($F{classes_class_begin_date}) + " -- " + new java.text.SimpleDateFormat("EEE, d MMM yyyy, hh:mm aa").format($F{classes_class_end_date}) Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted March 16, 2015 Share Posted March 16, 2015 Can I know why this was voted down? This is a solution which is working and which Im using for one report. 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