Retrieve value other then Value Column from an inputcontrol in iReport

I've an inputcontrol with Value Column:Value1. In visible Query Columns I've added Value1 and Value2. In the Report title I've added $P{[inputcontrol]} to the band and obviously Value1 is returned when I run the report. But I need Value2, how can I do this?

Thnx Remco

 

rtiel's picture
107
Joined: May 23 2013 - 1:07am
Last seen: 1 year 4 months ago

1 Answer:

$P{[inputcontrol]} shows nothing else than the value, which is passed from the executing environment to your report. For normal, you use this value i.e. as a unique id for a query or sth. else.

so, if you need value2 in your report, just create the input control with value column: value2 and visible columns whatever you like.

if you need both values in your report, either create two input controls, or select value1 and value2 as a concatenated column (seperated by a uniqe character or sth. similar), and strip them in your report (you can do this with 3 parameters, or String-split, or sth similar)

Cheers, Thomas

http://www.thomaszimmer.net

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 5 hours 45 min ago

Thnx, I succesfully used your first solution.

Remco

rtiel - 9 years 10 months ago
Feedback