Jump to content

default value for a parameter


pioppogatto

Recommended Posts

Hi, I have a report with two java.util.Collection parameters and my report query is like that in the Code.

In the report unit under jasperserver there are two input controls, pMacro is mandatory and pCategoria is not mandatory, but pCategoria get the report having all the values of the parameter if I didn't choose any value in the input control. How can I set the default value to gat ANY value? I try to put "" but I have an error

com.jaspersoft.jasperserver.api.JSExceptionWrapper: Errors were encountered when compiling report expressions class file: 1. Cannot cast from String to Collection value = (java.util.Collection)(""); //$JR_EXPR_ID=1$ <------------------------> 2. Cannot cast from String to Collection value = (java.util.Collection)(""); //$JR_EXPR_ID=1$ <------------------------> 3. Cannot cast from String to Collection value = (java.util.Collection)(""); //$JR_EXPR_ID=1$ <------------------------> 3 errors

 

Thank you

Code:
SELECT * FROMstatisticwhere  $X{IN, macrocategoria, pMacro} OR $X{IN, categoria, pCategoria}
Link to comment
Share on other sites

  • 2 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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