March 13, 2017 at 10:55 am
My report creates a patient list of radiology patients and has a parameter for ExamType, Location, Ordering MD, and Dictating MD. I want to be able to run the report based off any of these parameters, or should I be using Filters instead of parameters?
March 13, 2017 at 11:36 am
I think you've got it right - parameters are what you probably want to use. Filters are more for hardcoding certain limits on the report. For instance, your data set might pull up all locations, but you could have multiple tables on the report that each show the results for only one location. You would use filters within each table for that. But if you want to run the report different ways and get different results, parameters are the way to go.
March 13, 2017 at 11:42 am
How can I run the report using some of the parameters but not others? For example get all the Xrays for a particular location. Then, run the report again that includes all exam types but, include all locations. Or run the report for only one of the ordering doctors?
March 13, 2017 at 2:38 pm
NineIron - Monday, March 13, 2017 11:42 AMHow can I run the report using some of the parameters but not others? For example get all the Xrays for a particular location. Then, run the report again that includes all exam types but, include all locations. Or run the report for only one of the ordering doctors?
One way is to allow the parameter to be NULL and then in your report script, do something like this:
WHERE ( ColumnName = @parameterName OR @parameterName IS NULL )
Another way is to create a fake entry in your parameter like "ALL" or whatever other word you prefer, and do essentially the same thing:
WHERE ( ColumnName = @parameterName OR @parameterName = 'ALL' )
Finally, you can always make your parameters multi-select, and that way if you want to include (for example) all locations, you simply select all of the locations.
March 13, 2017 at 4:07 pm
Here's an article that shows you how...
https://www.mssqltips.com/sqlservertip/3453/sql-server-reporting-services-reports-with-optional-query-parameters/
March 14, 2017 at 9:54 am
Still can't get it to work so, I'm going to simplify the report.Thanx for the help
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply