Parameters in a Page Header

0

Hi all,

I have bunch of reports designed for client. The requirement is I need to show all the parameters being passed in the header . The problem is the parameters sent by system are codes- like VA, CT etc. I want to show the values in the header. If nothing is being passed, then I should show " All records" .  There are various datasets in some reports. 

I could add a lookup query in one report but I can only add one query.

How can I resolve this?

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

4 Answers:

0

Can use one or many TextFields in order to show parameters in the headers. 
Not sure what do you mean about values and codes. Is value a field in your dataset or how do you get it?
In case you have a particular value for each code, then you can hard-code it.
Ex:   $P{param1}.equals("VA") ? "VAvalue" : $P{param1}.equals("CT") ? "CTvalue" :  "No value"

For the last point you mention, can put these TextFields in a frame with a print when expression.
Print the Frame when there is at least 1 TextField that is not null. 
Ex. (field1 != null || field2!=null ||.... ) ? true : false
Then can use another Textfield with expression "All records" and you opposite print expression than Frame.
Ex: (field1 != null || field2!=null ||.... ) ? false : true

Let me know if any of this is helpful. If not, give me some more information so we can work it out.

Regards,
GL.

GonzaLinares's picture
Joined: Apr 17 2018 - 10:50am
Last seen: 11 months 2 days ago
0

Have you tried using scriplets to replace the code with the corresponding value?

https://community.jaspersoft.com/blog/all-you-want-know-about-scriptlets

hozawa's picture
52632
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago
0

You can add another lookup query by add a new Dataset. This is what I usually do in my report design.

riodavid's picture
507
Joined: Oct 27 2016 - 1:57am
Last seen: 1 year 1 week ago
0

I could add various lookup datasets . But i cant use them in the page header.  I am in a transition phase from SSRS where you can call the values stored in any dataset from anywhere. 

I will give an example. Lets say I have parameter call type , folder type, crime type . The application sends me value for parameters not the corresponding labels.  It is all stored in the database. 

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