Jump to content

Creating a cascading input control with a multi-select input control


Recommended Posts


I am using JasperServer 5.6.0 and iReport.  I am trying to create a cascading input control where the first input control (organization) is multi-select.   That input control seems to work properly.  The problem comes in when I try to create the 2nd level input control (unit).   

1st Level parameter = organization  (mult-select input control)

2nd Level parameter (cascading from organization) = unit  (multi-select input control)

This is the basic syntax I'm using for the query to populate the 2nd level (unit) input control.

select distinct UnitId, Name from Unit
where $X{IN,unit.unitorgid,organization}

When I execute the report on the server, I get no input controls.  When I look in the jasperserver.log, it is blank. I've tried restarting my services but doesn't seem to trigger any logging.  Hopefully someone can tell me what I'm doing wrong.


Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

I've found JasperReports Server input controls is OK for very simiple querying but found it to be very limited in functionalities to be useful in actual systems.

I had a situation where users wanted to enter multiple query fields, show results from the query, and then to select checkboxes on customers whom they wanted to generate a report. They also wanted all customers report to be generated in 1 single pdf file instead of a pdf file for each customer.

What I ended up doing was create a custom jsp page to do this.

Link to comment
Share on other sites

This did help. It's a bit quirky when the top level of a cascading input control is multiselect. The trick was in the query for the top level control. Previously I used.


Select uo.unitorgid as organization from unitorg uo


However, I descovered that the "as unitorgid" had to be changed to "as unitorg" since 'unitorg' is the id of the corresponding input control/parameter. I also had to put 'unitorg' as the value/display field for the input control. Previously when the organization control was single select, I used the database field name as the value field in the input control and it seemed to work fine.

Link to comment
Share on other sites

I am having trouble with my 2nd level parameter.  I am hoping someone can correct my syntax.

My first parameter is single select and it works:

<parameter name="QUESTIONNAIRE NAME" class="java.lang.String"><property name="parameter_type" value="select"/><property name="query" value="select distinct sd.display_name as displayName from srv_survey_definition sd where sd.active = true order by sd.display_name"/><parameterDescription><![CDATA[]]></parameterDescription><defaultValueExpression><![CDATA[]]></defaultValueExpression></parameter>

My second parameter is multi-select and it should reference first parameter.  It is not retrieving any results:
<parameter name="DISPLAY NAME" class="java.util.List" isForPrompting="false"><property name="parameter_type" value="multiselect"/><property name="query" value="select distinct display_name from srv_survey_definition where split_part(survey_name,'_OUTDATED',1) IN (select survey_name from srv_survey_definition sd where and sd.display_name = $P{QUESTIONNAIRE NAME})"/><defaultValueExpression><![CDATA[java.util.Arrays.asList(new String(" "))]]></defaultValueExpression></parameter>

Any suggestions are greatly appreciated.

Link to comment
Share on other sites

  • 2 years later...



I can't find this sample either.

It been almost two years since the last activity on this thread, so maybe it is not included in Jasper Server anymore.


However, I'm struggling with the same OP's problem. Does anyone have this sample?


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