Hi All,
I use a dataset from storedprocedure with 2 parameters:
GetItemsList (@.ItemCount as int , @.CategoryId as int)
In the dataset I write : exec GetItemsList
In the dataset parameter I connect the repotr parameter to the
storedprocedure parmeters.
If I set default value to the storedprocedure parameters:
GetItemsList (@.ItemCount as int = 0, @.CategoryId as int = 0)
the report work fine and pass the report parameters to the storedprocedure
(not 0 )
If I don't set default value to the storedprocedure parameters:
GetItemsList (@.ItemCount as int , @.CategoryId as int)
I get an error that the no value set to the storedprocedure parameters .
What is the problem ?
10x.There are two types of parameters: query parameters and report parameters.
RS tries to automatically create the report parameters for you and map it to
the query parameter. Note that you can change this mapping. For instance you
can map to an expression, you can use the same report parameter to several
query parameters, etc.
Anyway, it looks like RS did not automatically create the parameter for you.
Go to your dataset, click on the ..., change the command type to
storedprocedure, then put in GetItemsList as the query string (leave off the
exec). Now, go to layout and save. Then go to the menu Reports-> Report
Parameters. You should see two report parameters have been created. If you
want to see where the mapping occured go back to the dataset, click on the
..., parameters tab.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Liz Matyas" <lizmts@.mail.com> wrote in message
news:%23WT0Z57rFHA.4044@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> I use a dataset from storedprocedure with 2 parameters:
> GetItemsList (@.ItemCount as int , @.CategoryId as int)
> In the dataset I write : exec GetItemsList
> In the dataset parameter I connect the repotr parameter to the
> storedprocedure parmeters.
> If I set default value to the storedprocedure parameters:
> GetItemsList (@.ItemCount as int = 0, @.CategoryId as int = 0)
> the report work fine and pass the report parameters to the storedprocedure
> (not 0 )
> If I don't set default value to the storedprocedure parameters:
> GetItemsList (@.ItemCount as int , @.CategoryId as int)
> I get an error that the no value set to the storedprocedure parameters .
> What is the problem ?
> 10x.
>
Friday, March 23, 2012
RS2005 storedprocegere parameters
Labels:
categoryid,
database,
dataset,
exec,
getitemslist,
int,
itemcount,
microsoft,
mysql,
oracle,
parameters,
rs2005,
server,
sql,
storedprocedure,
storedprocegere,
write
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment