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?

0

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
13
Joined: Feb 27 2013 - 10:31am
Last seen: 3 years 1 month 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 - 5 years 7 months ago

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

jndh90 - 5 years 7 months ago

1 Answer:

0

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 http://www.rajeshsirsikar.com/?p=286

Rajesh SIrsikar

rajesh.sirsikar's picture
Joined: Apr 21 2014 - 5:43am
Last seen: 1 year 11 months ago

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

jndh90 - 5 years 7 months ago
Feedback