Amazon festival offer

Saturday 4 May 2013

Create an Input control in JasperServer



After creating the parameterized report in iReport, we are going to learn how to create an input control for a parameterized report in JasperServer.

Once you click Input Control, you will see a Create Input Control page, in this page you need to select the type of input control from drop down list, list contain so many types like Single Value, Single Select List of Values (radio), Multi Select List of Values, Single- select Query, and Multi-select Query. For the report which we developed in previous post we are going to create single-select query input control, all the query based input control such as single-select query fetch the data from database and shows as input control values in JasperServer.
Select Types- Single-select Query (radio)
            Prompt Text (required) – Select Year (Prompt for parameter)
            Parameter Name (required)-  p_year  (It’s case sensitive, it should be same as iReport parameter name )

Next, Enter Query Name then Next, select Do not link a data source and Next, In this step we have to define a query for input control.

                        SELECT DISTINCT year(ORDERDATE) year FROM ORDERS
Then Next and set Parameters Value:-
Value column- year (column of a query)
Visible column- year (column of a query) and click “add” and submit.



7 comments:

maxbell said...

Hi,
there's a way to add a default value to the input control?

i.e.:

From Name -> "A"
To Name -> "z"

now I see "--" and I have to select the "A" or "z" manually from the input control list every time I use the report.

Thank you for any suggestion
Massimo Bellicini (Italy)

maxbell said...

Hi,
there's a way to add a default value to the input control?

i.e.:

From Name -> "A"
To Name -> "z"

now I see "--" and I have to select the "A" or "z" manually from the input control list every time I use the report.

Thank you for any suggestion
Massimo Bellicini (Italy)

maxbell said...

Hi Sharad,
there's a way to add a default value to an Input control?

i.e. I would like to see:

From Name -> "A"
To nane -> "z"

instead of "--" .
I have to select the values from the input control list any time I use a report.

Thank you for any suggestion

Massimo Bellicini (Italy)

maxbell said...

Hi Sharad,
do you know a method to fill the input control with a default value?
Thank you

JPR said...

It's really helped me a lot, thank u very much for sharing this info.

RVirgie said...

Thanks!

Milan Gada said...

Hi
There is an requirement where drop down values in input control will be used as static which will not be coming from database.once user selects some value, I need fetch it and retrieve the result. The problem I am experiencing is fetching jasperserver input control value using jasper studio. Thank you