How to create a drop down list filter for the parameter in Jasper studio

0

Hello,

I have created a report in Jasper Studio by using a store procedure which is created in MSSQL. 

The report has been created by passing the query and parameters in DataSet and Query Dialog box. For example;

[reporting].[xyzproc] 'UniqueIndentifier, $x, $y, $z   

$x and $y are ReportStartDate and ReportEndDate while for $z I have made it hardcode that is I pass NULL, it will select the by default values under it.

What I want to achieve is when I hit the preview button, I want the user to select StartDate and EndDate which is actually happening already, but I also want now that $z should be drop down list and the user must be able to select the values in the list so that they get a filetered data for which they want the report.

Looking for a solution or reference to achieve it.

 

 

vipatil's picture
18
Joined: Mar 30 2017 - 4:05am
Last seen: 4 days 3 hours ago

5 Answers:

0

Jaspersoft Studio is just a editor to generate jrxml file. It's not a web page creator. In the preview mode, there's a feature to allow parameters to be entered but this is just a feature of Jaspersoft Studio and not of jrxml file (i.e. report).

Drop down feature that you're probably looking for is supported by JasperReports Server.

http://community.jaspersoft.com/documentation/tibco-jasperreports-server...

hozawa's picture
13404
Joined: Apr 24 2010 - 4:31pm
Last seen: 12 hours 42 min ago
0

@Hozawa

Thanks for the reply.

I am aware that in the preview mode, there is a feature to allow parameters to be entered. But what do I have to do if I have I want to select specific value from the parameter selected.

For example, If the parameter in preview mode is City, and I need a drop down list for that parameter where I could select the cities I want from the list.

 

vipatil's picture
18
Joined: Mar 30 2017 - 4:05am
Last seen: 4 days 3 hours ago
0

This can help you:

http://community.jaspersoft.com/wiki/customer-demo-how-create-multi-sele...

When you need something you can find it by searching in this web, it's what i have done.

Mariano

mlopez_1's picture
493
Joined: Oct 21 2013 - 8:08am
Last seen: 49 min 10 sec ago
0

Hello Mariano,

I have been through the article you have shared. I am stuck in the part where I have to edit the query.

I have created a report out of MSSQL store procedure by the follwing way;

[reporting].[xyzproc] $P{param1},$P{param2}$P{param3}  --This is a way of calling store proc in Studio

Now the article you have shared, asks us to use $X{IN,dbfieldName,CascadingParameter}, I am not able to understand how do I edit the [reporting].[xyzproc] $P{param1},$P{param2}$P{param3} and use the multilist parameter

 

vipatil's picture
18
Joined: Mar 30 2017 - 4:05am
Last seen: 4 days 3 hours ago
0

Create two query in jasperserver:

  - First with master query, countrys.

  - Second with slave query depending on parameter retrieved from first query.

Now create two input controls, with its parameters inside Report Unit.

  - First input control single select first query

  - Second input control single or multiple select with second query.

JasperServer refresh second input control automatically when change first input control.

Mariano

mlopez_1's picture
493
Joined: Oct 21 2013 - 8:08am
Last seen: 49 min 10 sec ago
Feedback