Niijimasama
Niijimasama

Reputation: 11

Jasper reports Parameter Form

Im pretty new to JasperReport Server. I have had success using JasperReport Sever 4.7(Community edition) and calling jasper reports (using jasperviewer)from within a java application.

My problem is: 1. To create my own parameter form which pops up when a user clicks a button linking to a jasper report.

  1. User to be able to enters the desired parameters (preferably selectable from a list) then when the user presses enter or ok on this page, it passes the values to the jasper report accordingly.

Any assistance would be highly appreciated.

Upvotes: 1

Views: 2681

Answers (1)

Rachcha
Rachcha

Reputation: 8816

For the first, when you create your report and save in your Jasper repository -

  1. Just right-clik the report folder (the one containing your Main.jrxml) and click on Properties. A dialog box appears.

  2. Go to Other tab. Next to Controls Layout label there will be a drop-down box. Select Pop-up Screen on that. Your job is done.

For the second, you can definitely have a select list. There are two ways to generate values for the list - by using a query or entering manually. The steps are:

  1. In your report folder in the repository, under your main.jrxml file there will be an Input Controls folder. Right click on it and click on Create a local input control. A dialog box will appear.

  2. On the General tab give the ID and name for the input control (ID must match to your respective parameter name).

  3. Go to Input Control Details tab. Select type as "Single Select Query" or "Single Select List of Values" as per your requirements. Enter the query or values and your job is done.

Upvotes: 1

Related Questions