[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Stored Proc Parameters in Reporting Services

Asked by AptDev in SQL Reporting, SQL Server 2005

Tags: Microsoft Reporting Services, TSQL Stored Proc

My users have two kinds of data they need to see in this report, Engineering data, or Production data.  And sometimes both.

In my Reporting Services report, I have a drop down combo box that shows PROD, ENG, and BOTH.

If my user selects ENG I'd like the stored procedure to limit the data:
WHERE Pool IN ('ENG_PM','DEV_RP')

If my user select PROD I would like my stored procedure to limit the data:
WHERE Pool IN ('FAB')

if my user passes BOTH, I'd like to include all of both of those, but nothing else.

So, in my Report, I created a parameter called POOL.  My plan was to have the user see one thing, but pass another.  In other words, have a parameter label (ENG) and a parameter value ('ENG_PM','DEV_RP')

So I got it all set up that way for all three scenarios.

In my stored proc, I added the line:
WHERE pool IN (@Pool)

But now when I run my report, I get zero data.

I'm passing two other parameters (StartDate and EndDate) so I know my parameters are working fine.  (I think I'm just passing something that looks bad when it gets to the other side.  Like maybe it's not OK to pass single quote tick marks, or maybe I need to pass parentheses as well, or something.)

If I could see what SQL statement my stored procedure is trying to run, I could probably figure out how to fix it.  But I'm not sure how to check what is actually being passed by the report (and received by the stored proc.)  Is there a way to see that?

Alternatively, if I knew how, I thought of just passing the word "PROD" (for example) to my Stored Proc and using an IF statement that translates it to the WHERE statement.  But my search of the web isn't showing me that that's a possiblity.  And TSQL isn't my native database language.

Any ideas?
[+][-]12/05/08 04:36 PM, ID: 23110030Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: SQL Reporting, SQL Server 2005
Tags: Microsoft Reporting Services, TSQL Stored Proc
Sign Up Now!
Solution Provided By: jgv
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625