Friday, March 30, 2012

Known fields are not returned by using a stored procedure

Hi,
I am trying to use a stored procedure to get data, but I can't get it right.
So far I have done this:
1) In the "Edit selected dataset" dialogue in the query tab I have entered
the name of the stored procedure.
2) In the Parameter tab I have entered the parameters for the stored
procedure, e.g. "@.UserId" etc.
3) I have added report parameters to the report and related them to the sql
parameters by selecting them in the parameter tab of the "Edit selected
dataset" dialogue.
For report parameters that should be null, I have checked "allow null" and
set default parameter to "None".
4) In the field tab of the "Edit selected dataset" I have entered field
names of fields, that I know that this stored procedure will return.
When I try to preview the report, I get an error message saying that there
are no fields corresponding to the field names I have entered. I have tried
query analyzer with the same parameters, and I know which fiels should be
there.
What am I doing wrong?
Thanks for any help.
DorteGoing against SQL Server I have yet seen the need to enter the fields by
hand (although it should have worked). What back end are you going against?
Have you tried clicking on the refresh field list button (it is the button
on the right of the ... that looks like the refresh button for IE)? Do you
get any data back when you execute it in the data tab. RS has to run the
stored procedure to be able to get the list. If you have a parameter then
when you do this (execute it from the data tab) it should prompt you for a
value.
Bruce L-C
"Dorte" <Dorte@.discussions.microsoft.com> wrote in message
news:ED389036-E3CC-4DF5-9BBB-17C133BC7A89@.microsoft.com...
> Hi,
> I am trying to use a stored procedure to get data, but I can't get it
right.
> So far I have done this:
> 1) In the "Edit selected dataset" dialogue in the query tab I have entered
> the name of the stored procedure.
> 2) In the Parameter tab I have entered the parameters for the stored
> procedure, e.g. "@.UserId" etc.
> 3) I have added report parameters to the report and related them to the
sql
> parameters by selecting them in the parameter tab of the "Edit selected
> dataset" dialogue.
> For report parameters that should be null, I have checked "allow null" and
> set default parameter to "None".
> 4) In the field tab of the "Edit selected dataset" I have entered field
> names of fields, that I know that this stored procedure will return.
>
> When I try to preview the report, I get an error message saying that there
> are no fields corresponding to the field names I have entered. I have
tried
> query analyzer with the same parameters, and I know which fiels should be
> there.
> What am I doing wrong?
> Thanks for any help.
> Dorte|||Now it works!
I'm using SQL server 2000, and I did allready enter the fields by hand, but
apparently that wasn't enough! But your advice to push the refresh button did
the
trick!!
Thanks a lot!
Dorte
"Bruce Loehle-Conger" wrote:
> Going against SQL Server I have yet seen the need to enter the fields by
> hand (although it should have worked). What back end are you going against?
> Have you tried clicking on the refresh field list button (it is the button
> on the right of the ... that looks like the refresh button for IE)? Do you
> get any data back when you execute it in the data tab. RS has to run the
> stored procedure to be able to get the list. If you have a parameter then
> when you do this (execute it from the data tab) it should prompt you for a
> value.
> Bruce L-C
> "Dorte" <Dorte@.discussions.microsoft.com> wrote in message
> news:ED389036-E3CC-4DF5-9BBB-17C133BC7A89@.microsoft.com...
> > Hi,
> > I am trying to use a stored procedure to get data, but I can't get it
> right.
> > So far I have done this:
> >
> > 1) In the "Edit selected dataset" dialogue in the query tab I have entered
> > the name of the stored procedure.
> >
> > 2) In the Parameter tab I have entered the parameters for the stored
> > procedure, e.g. "@.UserId" etc.
> >
> > 3) I have added report parameters to the report and related them to the
> sql
> > parameters by selecting them in the parameter tab of the "Edit selected
> > dataset" dialogue.
> > For report parameters that should be null, I have checked "allow null" and
> > set default parameter to "None".
> >
> > 4) In the field tab of the "Edit selected dataset" I have entered field
> > names of fields, that I know that this stored procedure will return.
> >
> >
> > When I try to preview the report, I get an error message saying that there
> > are no fields corresponding to the field names I have entered. I have
> tried
> > query analyzer with the same parameters, and I know which fiels should be
> > there.
> >
> > What am I doing wrong?
> >
> > Thanks for any help.
> >
> > Dorte
>
>sql

No comments:

Post a Comment