Monday, March 26, 2012

Microsoft Reporting Services - Error - Expects Parameter - Stored Procedure

Solution:
This happens to me quite a bit...its because the designer removes the
code that defines what
values are passed to your stored procedure.
You have to select the report you're working on > Right-Click 'Code' >
Locate the <Query> XML tag...and you'll have to re-define the
<QueryParameters>.
<Query>
<DataSourceName>GPS</DataSourceName>
<CommandType>StoredProcedure</CommandType>
<CommandText>spLRGetLeadRotationSummary</CommandText>
<QueryParameters>
<QueryParameter Name="@.StartDate">
<Value>=Parameters!StartDate.Value</Value>
</QueryParameter>
<QueryParameter Name="@.EndDate">
<Value>=Parameters!EndDate.Value</Value>
</QueryParameter>
<QueryParameter Name="@.RegionID">
<Value>=Parameters!RegionID.Value</Value>
</QueryParameter>
</QueryParameters>
</Query>You can also do this by clicking on the ..., parameters tab. Modifying the
xml is dangerous. Although if you have a lot of query parameters and RS
keeps losing it then I have sometimes saved the section off so I could copy
it back in.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<petejk@.gmail.com> wrote in message
news:1135124852.986963.63390@.f14g2000cwb.googlegroups.com...
> Solution:
> This happens to me quite a bit...its because the designer removes the
> code that defines what
> values are passed to your stored procedure.
> You have to select the report you're working on > Right-Click 'Code' >
> Locate the <Query> XML tag...and you'll have to re-define the
> <QueryParameters>.
>
> <Query>
> <DataSourceName>GPS</DataSourceName>
> <CommandType>StoredProcedure</CommandType>
> <CommandText>spLRGetLeadRotationSummary</CommandText>
> <QueryParameters>
> <QueryParameter Name="@.StartDate">
> <Value>=Parameters!StartDate.Value</Value>
> </QueryParameter>
> <QueryParameter Name="@.EndDate">
> <Value>=Parameters!EndDate.Value</Value>
> </QueryParameter>
> <QueryParameter Name="@.RegionID">
> <Value>=Parameters!RegionID.Value</Value>
> </QueryParameter>
> </QueryParameters>
> </Query>
>

No comments:

Post a Comment