Reputation: 31
The ant script throws error when compiling the .jrxml
to .jasper
file, only for the files which are using the JasperReports built-in functions. Please help me to resolve this issue.
The JasperReports version is 5.5.2. I've updated the jasperreports_extension.properties
with
net.sf.jasperreports.extension.registry.factory.functions=net.sf.jasperreports.functions.FunctionsRegistryFactory
net.sf.jasperreports.extension.functions.datetime=net.sf.jasperreports.functions.standard.DateTimeFunctions
net.sf.jasperreports.extension.functions.math=net.sf.jasperreports.functions.standard.MathFunctions, net.sf.jasperreports.functions.standard.LogicalFunctions
net.sf.jasperreports.extension.functions.text=net.sf.jasperreports.functions.standard.TextFunctions
The error trace from the ant build script:
[jrc] File : C:\Projects\JasperReport\src\main\report\Flower.jrxml ... FAILED.
[jrc] Error compiling report design : C:\Projects\DU\JasperReport\src\main\report\Flower.jrxml
[jrc] net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
[jrc] 1. The method DATEFORMAT(Date, String) is undefined for the type Flower_1400575815940_409825
[jrc] value = DATEFORMAT(new Date(((java.sql.Timestamp)field_TIMESHEETDATE.getValue()).getTime()),"MMMM"); //$JR_EXPR_ID=15$
[jrc] <-------->
[jrc] 2. The method DATEFORMAT(Date, String) is undefined for the type Flower_1400575815940_409825
[jrc] value = DATEFORMAT(new Date(((java.sql.Timestamp)field_TIMESHEETDATE.getOldValue()).getTime()),"MMMM"); //$JR_EXPR_ID=15$
[jrc] <-------->
[jrc] 3. The method DATEFORMAT(Date, String) is undefined for the type Flower_1400575815940_409825
[jrc] value = DATEFORMAT(new Date(((java.sql.Timestamp)field_TIMESHEETDATE.getValue()).getTime()),"MMMM"); //$JR_EXPR_ID=15$
[jrc] <-------->
[jrc] 3 errors
[jrc] at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)
[jrc] at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354)
[jrc] at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:270)
[jrc] at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:252)
[jrc] at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:402)
[jrc] at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:249)
[jrc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jrc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[jrc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[jrc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jrc] at java.lang.reflect.Method.invoke(Method.java:597)
[jrc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jrc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jrc] at org.apache.tools.ant.Target.execute(Target.java:392)
[jrc] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[jrc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[jrc] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[jrc] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[jrc] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[jrc] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[jrc] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[jrc] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Upvotes: 0
Views: 3745
Reputation: 31
The jasperreport 5.5.3 project build doesn't generating the jasper-functions-5.5.2.jar under the dist dir. We need to download the jasper-functions jar manually with joda-time jar as dependency.
Upvotes: 2