Displaying selected report parameter in Jasper Report

0

Hello All,

I have multiple parameters to generate report. I have to show selected parameters by user in report.

Currently I am showing all parameters and whichever is selected it also displays its value. If I hide unselected value then it will not in proper layout.

Can anyone please tell me how to show only selected parameter in report. Thanks in advance.

 

chavda.charmi's picture
Joined: Feb 13 2017 - 3:12am
Last seen: 2 months 1 week ago

1 Answer:

0

If i understand corectlly you have several text fields that you hide if parameter value is null/empty. You problem I assume is that if the 2nd parameter is null it will show 1st empty line 3rd instead of 1st,3rd. 

One option you have is to stack text fields on top of another, however than can get ugly if both stacked fields are not null.

Another option that i see, and this is not tested, but should work. Is to use a table object that has it's query generated by the prameters. Your query would be:

Select field_name from

(Select param1 as field_name

union

Select param2 as field_name

....

) a where filed_name is not null

this should generate a dynamically updated list of not null values for you to print and will keep the table layout

Alex42's picture
42
Joined: Dec 7 2016 - 4:24am
Last seen: 47 min 40 sec ago
Feedback