Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Procedure or function “” expects parameter '', which was not supplied

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.

Param Mapping

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>
like image 300
ExceptionLimeCat Avatar asked Aug 24 '15 19:08

ExceptionLimeCat


3 Answers

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.

like image 149
ExceptionLimeCat Avatar answered Nov 04 '22 12:11

ExceptionLimeCat


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

like image 21
duffn Avatar answered Nov 04 '22 14:11

duffn


Try Deleting the parameters and then going into the dataset properties and hit refresh fields, that should recreate them for you.

like image 2
NewGuy Avatar answered Nov 04 '22 14:11

NewGuy