Category: | Bug report |
Priority: | Normal |
Status: | New |
Project: | Severity: | Trivial |
Resolution: | Open |
|
Component: | Reproducibility: | Always |
Assigned to: |
Hi,
I have a problem with setting the parameters Class names in an hyperlink for a drill down report. I added my parameters in the "Link parameters" tab of the Hyperlink window and made sure to set the proper Class names. Two of those parameters have the java.util.Date Class names. After that, I tried my report on my Jasperreports Server, but got a "java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date" error. I went back to check my hyperlink parameters and they had reverted back to java.lang.String! I thought I had forgotten to set them, so I changed it again for java.util.Date. Tried again, still same error. Went back to check, they had reverted to String again! I poked around in iReport for a bit and found out the following : Class names remain to Date if I don't save my report, but get reverted to String if I save it (which causes the error on the server, since they end up being of String type). Those parameters have the Date class in my main report and the drill down report, they are not String anywhere. I tried a few more things and also found that this occurs with just about any other Class name as well, not just Date. Sometimes, I will be able to keep the Class name as I set it even after saving, but if I close iReport and reopen my report, they are reverted back to String. It seems to me that they are never actually changed to whatever I set them to, but remain of String type.
I thought I could maybe change it directly in the XML, but if I try to add the class in the hyperlinkParameter tag, iReport gives me this error : "Attribute 'class' is not allowed to appear in element 'hyperlinkParameter'."
I've been banging my head on this one, so if someone can do something about it, that would be most appreciated. If there's a possible workaround for this, I would like to know. If required, I can post my XML.
Thanks
3 Comments:
I first tested this in v5.0.0, but the same thing happened in v5.0.1 (the latest version AFAIK) when I tested it with very simple reports with only one parameter.
I also tested this in v4.5.1, and the very same thing occurs! How did people ever do drill down reports with iReport? Is there another way of doing it I don't know about? I followed the instructions in the JasperReports Server 4.2 Ultimate Guide (most recent Ultimate Guide I could buy)... If this could be fixed, I would be most grateful.
Actually, it does work fine, the fact that the hyperlink parameters get reverted to String doesn't seem to matter. The problem was that I was passing a Date parameter in an hyperlink inside a textfield which is inside a table element. The date seems to get passed as a string only when the hyperlink is in the table element. Kind of odd, actually. I will have to avoid using the table element until that gets fixed.