Jump to content

Jasper Server Multi Parameters


esusarrey

Recommended Posts

I'm ussing the option milt-select list of values (check box) to pass a parameter from JasperServer to my JRXML file and I get this error. Does any one know how can i get this values from the jasper server and use it in the report.

 

Thanks

 

 

 

java.lang.ClassCastException: java.lang.String

 

java.lang.ClassCastException: java.lang.String at com.jaspersoft.jasperserver.war.action.ReportParametersAction.bindParameterValues(ReportParametersAction.java:876)

 

at com.jaspersoft.jasperserver.war.action.ReportParametersAction.getParameterValues(ReportParametersAction.java:177)

 

at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:260)

 

at com.jaspersoft.jasperserver.war.action.ViewReportAction.verifyData(ViewReportAction.java:175)

 

at sun.reflect.GeneratedMethodAccessor370.invoke(Unknown Source)

 

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

 

at java.lang.reflect.Method.invoke(Unknown Source)

 

at org.springframework.webflow.util.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:103)

 

at org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:136)

 

at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:203)

 

at org.springframework.webflow.engine.AnnotatedAction.execute(AnnotatedAction.java:142)

 

at org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:61)

 

at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:180)

 

at org.springframework.webflow.engine.State.enter(State.java:200)

 

at org.springframework.webflow.engine.Transition.execute(Transition.java:229)

 

at org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)

 

at org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)

 

at org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:207)

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

I had a very similar looking error message when using the multi-select check boxes. These 2 posts helped me out a great deal:

 

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=23959#23959

 

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=15906&catid=10&limit=6&limitstart=0

 

In my case I wanted a multi select to use with a SQL IN statement (WHERE column name IN (list of parameters)

 

Is this what you were trying to do?

 

If so, I solved my issue by using a parameter of type java.util.collection in the report, and then in my query using $X e.g.

 

WHERE $X{IN,column ,parameter name}

 

HTH

Link to comment
Share on other sites

  • 5 months later...

Hi, I found your information is very useful.

 

I try to locate the 2 postings you recommended but they are not available any more. Could you please double check and update the links again? If not, would you at least list the title of both listings so that I can search for them?

 

thank you very much,

Jenny

Link to comment
Share on other sites

Here is example of multi-select InputControl, I will post only key parts of JRXML which are parameter declaration and SQL syntax.

<parameter name="P_Country" isForPrompting="true" class="java.util.Collection"></parameter>
<queryString><![CDATA[select * from orders where $X{IN, SHIPCOUNTRY, P_Country}]]></queryString>
 

Example uses SugarCRM sample DB. Note the java.lang.Collection class as a parameter java type. Setting it to java.lang.String may cause the error you see. Use String only in case of single value.

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...