Jump to content
We've recently updated our Privacy Statement, available here ×

Issue with Parameter


camnott
Go to solution Solved by camnott,

Recommended Posts

I have the following Parameter :
<parameter name="p_class_choice" class="java.util.Collection" nestedType="java.lang.String">
     <parameterDescription><![CDATA[]]></parameterDescription>
</parameter>

my Query :

SELECT sr.challenges Challenges,
pmp.CLASS Class,
prc.PRNAME ChargeCode,
sr.goodnews Goodnews,
sr.cop_report_date ReportDate,
iinv.NAME ProjectName,
iinv.CODE ProjectID
FROM niku.ODF_CA_COP_PRJ_STATUSRPT sr
LEFT JOIN niku.INV_INVESTMENTS iinv ON sr.ODF_PARENT_ID=iinv.ID
LEFT JOIN niku.PAC_MNT_PROJECTS pmp ON iinv.ID=pmp.ID
LEFT JOIN niku.PRCHARGECODE prc ON iinv.CHARGECODEID=prc.PRID
WHERE sr.cop_report_date >=$P{p_start_date}
AND sr.cop_report_date <=$P{p_end_date}
AND $X{IN, pmp.CLASS,p_class_choice}

I had the pmp.CLASS field sorted with "AND NOT pmp.CLASS in (abc,123,etc...) " prior.
Needed to make a multi select query for expanded reporting purposes.

Causes :

net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:468)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$18(ReportControler.java:443)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler$4.run(ReportControler.java:335)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
at net.sf.jasperreports.engine.fill.JRFillSubreport.getParameterValues(JRFillSubreport.java:556)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateParameterValues(JRFillSubreport.java:429)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:409)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:307)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:456)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2067)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:649)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:571)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:296)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:152)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:963)
at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFiller.run(BaseFillHandle.java:120)
at java.lang.Thread.run(Unknown Source)
 
Any thoughts?

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

So - This is a foolish mistake I made. Thank you for your answer Mariano, but I figured out what I was doing wrong.

When I was trying to pass parameters down to the sub report, I apparently mapped this parameter to the report by mistake, instead of passing it down.

When it tried to call the report, it was trying to map the parameter, throwing the error.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...