2
votes

I'm using iReport 4.6.0 and JasperReports Server 4.5.0. I've created a report where I want to pass a date value to a MySQL database. I've created a parameter and used java.util.Date class. On the input control, I set it to a single value type, and the date data type. When running the report in iReport (using Preview), I'm prompted to select a date, and it generates the report using the specified date. After deploying the report to the JasperReports Server, when I'm prompted to enter a date, I get an empty report. I noticed the date format is different on the input control on the server (YYYY-MM-DD) than the one when previewing the report in iReport (MM/DD/YYYY). Is there any way to fix this?

1
The different formatting of the date doesn't mean there is a problem. Set the report to display "All sections, no data" when the query has no results. And display the parameter in the title band. Then you'll know for sure if the problem is with the date entered. - mdahlman
I added the parameter to the page and it returned null. Tom's solution fixed it. - Jeff

1 Answers

4
votes

I agree with mdahlman. The formatting of the input control shouldn't be a problem. It should be passing a valid date value to the report.

Make sure that the name of the input control (not the label) exactly matches the name of your parameter. And it is case sensitive. If they are not identical, this could be your problem.