2

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?

2
  • 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
    Aug 15, 2012 at 20:56
  • I added the parameter to the page and it returned null. Tom's solution fixed it.
    – Jeff
    Aug 16, 2012 at 16:07

1 Answer 1

4

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.

2
  • When I created the input control, I used all lower case letters. When I created the parameter, I used all upper case letters. Deleting the input control and creating a new one, with the ID in all upper case letters, fixed the issue. Thanks for the help!
    – Jeff
    Aug 16, 2012 at 16:06
  • Glad I could help. I've run into that issue more than once in the past.
    – Tom
    Aug 16, 2012 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.