Input Controls on Jaspersoft AWS

0
Running Jaspersoft Business Intelligence Server on AWS:
I am seeing several curious things regarding Input Controls. I wanted to add a parameter to a report, so I created an Input Control - a dropdown list that supports multiple selection. 
When I run the report though, the Input Control appears, but all of the entries are blank. They're there, and you can select them, but they appear as blank lines. 
 
No problem, I thought -- maybe I did something wrong. So I went to the report in the repository, selected it and then clicked on the "Edit" button up on the menu bar at the top of the list of reports. 
I get the "Set Up the Report" page, with a little menu box on the left with the selections: "Set Up", "Controls & Resources", and so on. I select "Controls & Resources" and on the resulting page are all 
of the Input Controls for the report. Each control is a clickable link (I see in the browser status bar that clicking on a control will invoke: javascript:resourceReport.editControl('controlName')
 
Great, so I click on the link for the control and then - the next page is "Locate Input Control". The choices are 1) Define an Input Control in the next step, or 2) Select an Input Control from the repository
Well, I don't think that I want to "define" one, I did that already. So I select Select from the repository but then I cannot find the control anywhere in the repository. So I am stuck. 
 
Try this for the Freight Report (/organizations/organization_1/reports/samples/Freight). Try and locate the "Country" input control. I don't know if this is maybe a permissions/roles issue, but I tried it with
jasperadmin, superuser, our users with our roles, etc etc
 
Should we be able to edit Input Controls? Thanks for any insight.

This may be related to: http://community.jaspersoft.com/questions/811820/input-controls-jasperse...

mr.john.lynn's picture
Joined: Mar 4 2013 - 3:18pm
Last seen: 2 years 8 months ago

3 Answers:

0

Hi John - Based on your reference to the Freight report, I assumed you're using iReport and not the Ad Hoc report designer. If you're using Ad Hoc, then I need a bit more info on exactly what you're doing. Otherwise, continue on.

Mastering the input control is very liberating. What you ran into is the flip side of a feature that is flexible and powerful. Unfortunately it was not obvious.

I'll use your suggestion of the Freight report as an example. When you edit the Freight report unit and click the Controls and Resources tab, you see three input controls: Country, RequestDate and OrderId. These input controls were created to be part of the report unit. You can think of them as tightly bound. I recommend that you NOT set them up this way, but as reusable controls, but you'll learn that when you get to the reference material at the end..

To see how this input control is defined, click on it. The Locate Input Control opens, and as you note, there are two choices. The first is what you want, and it really should read "Define or Edit an Input Control in the next step." Click Next.

On the Create Input Control page, you can type anything you want for the prompt. It could be as simple as "Country" or more elaborate, such as "Select a country from the list", etc. The really really important part to making the input control work with your report is to exactly match the Parameter Name. This value needs to be the same spelling and case as the parameter in your report. References on how to do this at the end of this post.

Back to the example. The Type selected for this input control is "Single-select Query". Click Next. The Locate Query page appears. Again, the first option should read "Define or Edit a Query in the next step." With that selected, click Next. 

The next three steps walk you through naming the query as a resource, selecting its data source (what are you going to query) and then the query itself. 

After you click Save, you'll see the Set Parameter Values page. It's not important for our example, and it can be confusing or seem redundant. For our example, just click Submit. Now, I'll tell you the reason for this page. Assume for a moment that your database includes two columns - one for the Country name (e.g., type = varchar) and another for the Country code (e.g., type = smallint). For the sake of efficiency, maybe you want to use the Country code (e.g., smallint) in the database WHERE clause instead of the varchar. But to minimize human error, you want to present the list of country names (e.g., varchar) to the user. This page allows you to do that with the "value" and "visible" columns. In this hypothetical example, the visible column could be country name and the value could be country code. To make this work, the SQL statement on the previous page needs to include both columns, e.g., something like this: 

select country, countryCode from ORDERS group by countryCode order by country

I added the order by so the country names would be in alphabetical order for the humans. If your data is pre-sorted in the database it may not be necessary.

Hopefully this gives you enough to accomplish your near-term goal. Here's more information to help you out:

Online help: http://help.jaspersoft.com/js-help-v5-en//Default.htm#search-input control

JasperReports Server Administration Guide, sections 4.3 and 4.4: http://community.jaspersoft.com/documentation/jasperreports-server-administration-guide

iReport Ultimate Guide, section 6.2.1 Using Parameters in a Query: http://community.jaspersoft.com/documentation/ireport-ultimate-guide

I hope this helps.

Mary Flynn

Jaspersoft

mmflynn's picture
1696
Joined: Sep 19 2006 - 5:43am
Last seen: 6 years 3 months ago
1

That is capable of misunderstood, what you want indeed is to "define" an input control. Select that and the next buttons will bring you to editing your control.

BTW, I would recommend to define input controls once in the repository of JS, then only link them to your reports (especially you are using the same input control for multiple reports, that will ake maintainability much more easy).

As I can see in my test server, you will have to select the "visible column" explicitely at the end of the controls configuration dialogs. Otherwise the presentation of the control won´t show anything.

Cheers, Thomas

http://www.thomaszimmer.net

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 5 days 12 hours ago
0
Thank you  very much for your assistance! 
 
I am indeed using iReport, editing the report and then using "Replace with current document" in the Repository Navigator. 
 
It's helpful to realize that the "Define an Input Control in the next step" can really be interpreted as "Thank you  very much for your assistance! It's helpful to realize that the "Define or Edit an Input Control in the next step." Once that's selected, it's really just a series of "Next" button clicks to go through the steps of editing the input control. 
 
I was able to fix the query that the control uses. Now all I need to do is get the parameter for the report working so that I actually get results! 
 
Thanks again.

 

 

mr.john.lynn's picture
Joined: Mar 4 2013 - 3:18pm
Last seen: 2 years 8 months ago
Feedback
randomness