display visible section of input control on header

0

I have a report where i have configured input control using Single Select Query .

select code,description

from code_lookup

where table_name ='folder_type'

In this query, I have set up code as Value name and description as visible column

Here is the sample data -

code .        description

DMV .      Domestic Violense

HATE .    hate crme

If the user selects Domestic Violence, then I want to display in report header and not DMV.

How can I achieve this?  I have seen multiple solutions on this but none work.

 

avernekar's picture
Joined: Mar 1 2018 - 11:33am
Last seen: 11 months 17 hours ago

4 Answers:

0

That's what we do:

We will write a stored procedure to translate the codes, for example:

SELECT name FROM table WHERE code = 'DMV'

Then we will create a new Dataset in Studio, sourcing data from that stored procedure.

In the title part, retrieve data from the newly created Dataset. There you can get the whole description of that code.

riodavid's picture
502
Joined: Oct 27 2016 - 1:57am
Last seen: 8 months 2 weeks ago
0

Thats what I do. Its doable If i have one query to refer to. But I have reports where there are 12 parameters. In page header, I can't call the values from subdatasets. That's the part  I dont like about Jaspersoft. 

There has to be some way to achieve this. 

avernekar's picture
Joined: Mar 1 2018 - 11:33am
Last seen: 11 months 17 hours ago
0

You can pass all the 12 parameters to a stored procedure, to generate a result set that contains 12 descriptions. For example:

https://postimg.cc/image/w6idjbei5/

riodavid's picture
502
Joined: Oct 27 2016 - 1:57am
Last seen: 8 months 2 weeks ago
0

Where should I use that stored procedure?I certainly don't want to use as subdataset since I can't call it in page header.

avernekar's picture
Joined: Mar 1 2018 - 11:33am
Last seen: 11 months 17 hours ago
Feedback