?
Solved

Stored Procedure to pass parameter to another SSRS report

Posted on 2010-08-24
2
Medium Priority
?
859 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
rashmi_vaghela earned 2000 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

765 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