This may be related to: http://community.jaspersoft.com/questions/811820/input-controls-jasperse...
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:
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.
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.