Solved

Stored Procedure to pass parameter to another SSRS report

Posted on 2010-08-24
2
848 Views
Last Modified: 2012-06-27
Hi Experts,

I have been unemployed since May and I will land this job if I can prove that I can pass parameters from one SSRS report to another with a Stored Procedure.

There are 2 reports, Sales Person Performance and Sales Person Detail.
In the performance table ContactID column I have a navigation property that jumps to the detail report. I pass both of the date parameters there.

I need to figure out how to make an SP that will grab the value of the ContactID that was clicked on and make it available for use as a parameter in the detail report.

Can anyone show me how to create such a procedure and use the value as a parameter in my detail report?

I am pasting the queries for the data sets for both reports below.

Performace Report:
SELECT     TOP (10) SUM(Sales.SalesOrderHeader.TotalDue) AS TotalDue, Person.Contact.FirstName, Person.Contact.LastName, Person.Contact.ContactID
FROM         Sales.SalesOrderHeader INNER JOIN
                      Person.Contact ON Sales.SalesOrderHeader.ContactID = Person.Contact.ContactID INNER JOIN
                      Sales.SalesPerson ON Sales.SalesOrderHeader.SalesPersonID = Sales.SalesPerson.SalesPersonID
WHERE     (Sales.SalesOrderHeader.OrderDate BETWEEN @StartDate AND @EndDate)
GROUP BY Person.Contact.LastName, Person.Contact.FirstName, Person.Contact.ContactID
ORDER BY TotalDue DESC

Detail Report:
SELECT     Sales.SalesOrderHeader.TotalDue, Person.Contact.FirstName, Person.Contact.LastName, Person.Contact.ContactID
FROM         Sales.SalesOrderHeader INNER JOIN
                      Person.Contact ON Sales.SalesOrderHeader.ContactID = Person.Contact.ContactID INNER JOIN
                      Sales.SalesPerson ON Sales.SalesOrderHeader.SalesPersonID = Sales.SalesPerson.SalesPersonID
WHERE     (Sales.SalesOrderHeader.OrderDate BETWEEN @DetailStartDate AND @DetailEndDate)
ORDER BY Person.Contact.ContactID

My 3rd interview with this company is this Thursday 8/26/2010
Any help would be so greatly appreciated!

Thanks

Dan
 
0
Comment
Question by:DanPerlman
2 Comments
 
LVL 7

Accepted Solution

by:
rashmi_vaghela earned 500 total points
ID: 33518214
0
 

Author Comment

by:DanPerlman
ID: 33525179
rashmi,

I have looked at the links provided. I don;t see what I'm looking for.
I need a stored procedure to get the value of the cell in the table that the user clicked on. When the jump to report fires, I need to use that specific value as a parameter in the detail report. I only want to display the contact id that was selected from the performance report in the detail report.
Does that make sense?

Thanks

Dan
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
How to increase the row limit in Jasper Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question