all groups > sql server reporting services > september 2005 >
You're in the

sql server reporting services

group:

Passing parameters from a report to another report



Passing parameters from a report to another report Paul
9/28/2005 11:23:40 PM
sql server reporting services: I have a drill down report which I have specified in the action with the
second report name and also specified the parameters to pass to that report.
I am using store procedure for the reports. When click on the first report
to open the second report, it comes back with an error saying "Procedure
'rpt_Monthly_Sales_Detail' expects parameter '@Year', which was not
supplied.". The following is the store procedure used in the second
report...

CREATE PROCEDURE [dbo].[rpt_Monthly_Sales_Detail]
@Year nvarchar(255),
@MonthName nvarchar(255)

AS

DECLARE
@IntYear nvarchar(255),
@IntMonthName nvarchar(255)

SELECT Query1.CustomerID,
Query1.CustomerName,
Sum(Query1.SubTotal) AS SumOfSubTotal,
Query1.IntYear,
Query1.IntMonthName
FROM (
SELECT Tbl_Customer_CRM.CustomerID,
Tbl_Customer_CRM.CustomerName,
DATEPART(Year,[Invoicedate]) AS IntYear,
DATENAME(Month,[invoicedate]) AS IntMonthName,
Tbl_Event.EventStatus,
Sum(Tbl_Sales.Quantity) AS SumOfQuantity,
Tbl_Sales.UnitCost,
Sum([Quantity])*[UnitCost] AS SubTotal
FROM Tbl_Customer_CRM
INNER JOIN Tbl_Sales
ON Tbl_Customer_CRM.CustomerID = Tbl_Sales.CustomerID
INNER JOIN Tbl_Event
ON Tbl_Event.EventID = Tbl_Sales.EventID
GROUP BY Tbl_Customer_CRM.CustomerID,
Tbl_Customer_CRM.CustomerName,
DATEPART(Year,[Invoicedate]),
DATENAME(Month,[invoicedate]),
Tbl_Event.EventStatus,
Tbl_Sales.UnitCost
HAVING (((Tbl_Event.EventStatus)=1))
) AS Query1
WHERE (((Query1.IntYear)= @Year)
AND ((Query1.IntMonthName)=@MonthName))
GROUP BY Query1.CustomerID,
Query1.CustomerName,
Query1.IntYear,
Query1.IntMonthName
ORDER BY Query1.CustomerName

Re: Passing parameters from a report to another report Hoa
9/30/2005 8:20:43 PM
Maybe this can help you look for the problem area:
1. Verify in the first report that year parameter is passed to the
second report. I suppose you are doing a jump to report. There is a
parameters button in the navigation tab.
2. The second report must also have year defined as a report parameter.
AddThis Social Bookmark Button