I have an SSRS report to which I am passing a Start Date and End Date parameter but I keep receiving the following error:
Procedure or function 'MyReport' expects parameter '@startDate', which was not supplied.
I have created a parameter in my report and mapped it in my DataSet. I do not understand what I'm missing here. Any ideas? Any help is much appreciated.
SQL
ALTER PROCEDURE [dbo].[MyReport]
@startDate datetime,
@endDate datetime
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT *
FROM myReportTbl tbl
WHERE tbl.[Updated] >= @startDate
AND tbl.[Updated] <= @endDate
END
Report Code
<DataSet Name="DataSet1">
<Query>
<DataSourceName>Dev</DataSourceName>
<QueryParameters>
<QueryParameter Name="@startDate">
<Value>=Parameters!StartDate.Value</Value>
<rd:UserDefined>true</rd:UserDefined>
</QueryParameter>
<QueryParameter Name="@endDate">
<Value>=Parameters!EndDate.Value</Value>
<rd:UserDefined>true</rd:UserDefined>
</QueryParameter>
</QueryParameters>
<CommandText>MyReport</CommandText>
</Query>
I found the issue. It was pretty dumb of me but I swear I'd done this in the past. I had set the Query Type
in the dataset to Text
and it should be Stored Procedure
.
Check that the case of the parameters is correct. I've received errors in the past due to case issues.
Report parameters are case-sensitive.
https://msdn.microsoft.com/en-us/library/ms155391.aspx
Try Deleting the parameters and then going into the dataset properties and hit refresh fields, that should recreate them for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With