I have design report using iReport. In this report I have one custom function which takes year and the month as input and return max days in that month.
This method using java.util.Calendar API internally to get max days in the given month and year.
This reports works fine with iReport, but as soon as I import this report in JasperReports Server I am getting this exception.
Error Message
java.lang.IllegalStateException: Processor of type com.jaspersoft.jasperserver.war.cascade.handlers.converters.DataConverter for class
java.util.GregorianCalendar not configured
How to resolve this issue in JasperReports Server? How to configure this class in JasperReports Server?
After researching for above problem, I myself manage to work it out.
I have looked into the data converters configuration of JasperServer but there is no as such Data converter available for Calendar class.
To best way I have found is that to create you custom class in which write your whole logic that you want to perform with java Calendar class and package it into jar. Now use use that jar API directly to solve you purpose.
In my case I wanted to calculate the reporting period (Time period for which I am generating report). For me the input for this result was month and the year for which I am generating the reports. So below is my code snippet I have written
Then I have used this jar in both iReports as well as in JasperServer to get the desired result from the input.