How to pass a parameter (client_status) with one of three selections, All, Active, None and when client_status is set to None to not use this as a condition in the where statement when running the sql?

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.

I have a report that shows provider information and client information, when the user selects what client status to see on the report I don't want this to effect how the rest of the report runs. If the user selects Active then I want Active clients to print on the report, if the user selects All I want all clients to print regardless of client status, but if the user selects None this means do not print any clients on the report (but I still want the  provider information to print).  I am not sure 1) if I need to pass parameter to the report query, 2)if I do how write the sql to not use the expression when the client status is none, 3)if I don't and use the print when expression how to I define the parameter so it knows what All means?

jndh90's picture
Joined: Feb 27 2013 - 10:31am
Last seen: 5 years 4 months ago

What you are describing sounds straightforward with techniques like $P{} SQL injection in the WHERE clause, Print When Expressions on subreports or creative use of grouping. But, you will need to provide more info if how want prescriptive assistance. Thanks

sfriedman - 7 years 10 months ago

Thank you for commenting.  I have made changes within the report query to do what I need it to do.

jndh90 - 7 years 10 months ago

1 Answer:

Hi jndh9,

The Best possible way to achieve what you are looking for is to create a parameter driven SQL to run your report. For detailed explanation, check my blog

Rajesh SIrsikar

rajesh.sirsikar's picture
Joined: Apr 21 2014 - 5:43am
Last seen: 4 years 2 months ago

Thank you for the post, your blog looks to be very helpful and informative.

jndh90 - 7 years 10 months ago