Date function compile problem

0

 have a report (javabean collection datasource) which uses a date function - DATEFORMAT($F{meetingDate},"EEEE dd MMMM yyyy").  The report runs fine in eclipse and if I remove the function it runs properly through java.  

With the function I get the following errors though 

 
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The method DATEFORMAT(Date, String) is undefined for the type ******
                value = DATEFORMAT(((java.util.Date)field_OBSDate.getValue()),"EEEE dd MMMM yyyy"); //$JR_EXPR_ID=10$
                        <-------->
2. The method DATEFORMAT(Date, String) is undefined for the type *******
                value = DATEFORMAT(((java.util.Date)field_OBSDate.getOldValue()),"EEEE dd MMMM yyyy"); //$JR_EXPR_ID=10$
                        <-------->
3. The method DATEFORMAT(Date, String) is undefined for the type *******
                value = DATEFORMAT(((java.util.Date)field_OBSDate.getValue()),"EEEE dd MMMM yyyy"); //$JR_EXPR_ID=10$
                        <-------->
3 errors
 
My required date formatt is MM-DD-YYYY  HH:mm:SS
 
avinash.eng18's picture
Joined: Jan 18 2016 - 10:24pm
Last seen: 5 days 20 hours ago

2 Answers:

1

You'll need to include the jasperreports-functions jar in your project, put it on your class path etc. to be able to use dateformat

Jar file available here:

http://community.jaspersoft.com/project/jasperreports-library/releases

darth_fader's picture
Joined: Mar 7 2010 - 9:45pm
Last seen: 11 hours 25 min ago
0
i have made the suggested change but still not able to achieve the result.. any help.. it still throws the same error.
avinash.eng18's picture
Joined: Jan 18 2016 - 10:24pm
Last seen: 5 days 20 hours ago
Feedback
randomness