Friday, March 30, 2012

Report Parameter Problem

I have a report based on a stored procedure with three parameters: Start
Date, End Date, and Salesperson.
The first two are required, and the Salesperson is not. In the report, the
Salesperson is based on a query which provides a drop down for choosing a
name. It is set to allow nulls and blanks.
When I run the report in Visual Studio preview, if no Salesperson is chosen,
and both dates are entered, no data is returned. Doing the same thing via
debug in a browser, (the drop down is not blank, but says <Selelct a value>),
I get prompted to supply the Salesperson parameter.
Supplying a value for Salesperson in both cases works fine, but I want the
user to have the option to get all the data, not just for a particular
person. I've covered this case in the stored procedure, so I'm not sure what
is getting passed in the previewer when nothing is entered and no data is
returned.
If I run the query (sp) via the Data tab, and provide exactly the same
values for the parameters, I get the data I expect, and no prompt for the
Salesperson.
If I put a default value in for the Salesperson, (non-queried), e.g. "All",
the preview in VS goes crazy, and locks up.
I would have thought with allowing nulls and/or blanks, this should work. Am
I missing something?
Thanks for any help,
TomIf Salesperson parameter uses available values from query, then the query
must return null or blank as one of available values.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"TomT" <tomt@.newsgroup.nospam> wrote in message
news:87D78917-4603-4339-AD5B-C4C3377BA9AA@.microsoft.com...
>I have a report based on a stored procedure with three parameters: Start
> Date, End Date, and Salesperson.
> The first two are required, and the Salesperson is not. In the report, the
> Salesperson is based on a query which provides a drop down for choosing a
> name. It is set to allow nulls and blanks.
> When I run the report in Visual Studio preview, if no Salesperson is
> chosen,
> and both dates are entered, no data is returned. Doing the same thing via
> debug in a browser, (the drop down is not blank, but says <Selelct a
> value>),
> I get prompted to supply the Salesperson parameter.
> Supplying a value for Salesperson in both cases works fine, but I want the
> user to have the option to get all the data, not just for a particular
> person. I've covered this case in the stored procedure, so I'm not sure
> what
> is getting passed in the previewer when nothing is entered and no data is
> returned.
> If I run the query (sp) via the Data tab, and provide exactly the same
> values for the parameters, I get the data I expect, and no prompt for the
> Salesperson.
> If I put a default value in for the Salesperson, (non-queried), e.g.
> "All",
> the preview in VS goes crazy, and locks up.
> I would have thought with allowing nulls and/or blanks, this should work.
> Am
> I missing something?
> Thanks for any help,
> Tom|||Lev, thanks, I was assuming if no choice was made (drop down blank) a null
would be passed. I fixed it up to provide a value simulating a null
situation, and it now works fine.
Thanks for your quick response...
Tom
"Lev Semenets [MSFT]" wrote:
> If Salesperson parameter uses available values from query, then the query
> must return null or blank as one of available values.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "TomT" <tomt@.newsgroup.nospam> wrote in message
> news:87D78917-4603-4339-AD5B-C4C3377BA9AA@.microsoft.com...
> >I have a report based on a stored procedure with three parameters: Start
> > Date, End Date, and Salesperson.
> >
> > The first two are required, and the Salesperson is not. In the report, the
> > Salesperson is based on a query which provides a drop down for choosing a
> > name. It is set to allow nulls and blanks.
> >
> > When I run the report in Visual Studio preview, if no Salesperson is
> > chosen,
> > and both dates are entered, no data is returned. Doing the same thing via
> > debug in a browser, (the drop down is not blank, but says <Selelct a
> > value>),
> > I get prompted to supply the Salesperson parameter.
> >
> > Supplying a value for Salesperson in both cases works fine, but I want the
> > user to have the option to get all the data, not just for a particular
> > person. I've covered this case in the stored procedure, so I'm not sure
> > what
> > is getting passed in the previewer when nothing is entered and no data is
> > returned.
> >
> > If I run the query (sp) via the Data tab, and provide exactly the same
> > values for the parameters, I get the data I expect, and no prompt for the
> > Salesperson.
> >
> > If I put a default value in for the Salesperson, (non-queried), e.g.
> > "All",
> > the preview in VS goes crazy, and locks up.
> >
> > I would have thought with allowing nulls and/or blanks, this should work.
> > Am
> > I missing something?
> >
> > Thanks for any help,
> >
> > Tom
>
>|||TomT
Could you please tell me how did you simulate a value of null. I am running
into exactly same problem as yours where I cant make paramter optional as
Report Manager forces me to choose a value although I have defined null and
blank as options for the parameter.
TIA
"TomT" wrote:
> Lev, thanks, I was assuming if no choice was made (drop down blank) a null
> would be passed. I fixed it up to provide a value simulating a null
> situation, and it now works fine.
> Thanks for your quick response...
> Tom
> "Lev Semenets [MSFT]" wrote:
> > If Salesperson parameter uses available values from query, then the query
> > must return null or blank as one of available values.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "TomT" <tomt@.newsgroup.nospam> wrote in message
> > news:87D78917-4603-4339-AD5B-C4C3377BA9AA@.microsoft.com...
> > >I have a report based on a stored procedure with three parameters: Start
> > > Date, End Date, and Salesperson.
> > >
> > > The first two are required, and the Salesperson is not. In the report, the
> > > Salesperson is based on a query which provides a drop down for choosing a
> > > name. It is set to allow nulls and blanks.
> > >
> > > When I run the report in Visual Studio preview, if no Salesperson is
> > > chosen,
> > > and both dates are entered, no data is returned. Doing the same thing via
> > > debug in a browser, (the drop down is not blank, but says <Selelct a
> > > value>),
> > > I get prompted to supply the Salesperson parameter.
> > >
> > > Supplying a value for Salesperson in both cases works fine, but I want the
> > > user to have the option to get all the data, not just for a particular
> > > person. I've covered this case in the stored procedure, so I'm not sure
> > > what
> > > is getting passed in the previewer when nothing is entered and no data is
> > > returned.
> > >
> > > If I run the query (sp) via the Data tab, and provide exactly the same
> > > values for the parameters, I get the data I expect, and no prompt for the
> > > Salesperson.
> > >
> > > If I put a default value in for the Salesperson, (non-queried), e.g.
> > > "All",
> > > the preview in VS goes crazy, and locks up.
> > >
> > > I would have thought with allowing nulls and/or blanks, this should work.
> > > Am
> > > I missing something?
> > >
> > > Thanks for any help,
> > >
> > > Tom
> >
> >
> >|||TomT
Could you please tell me how did you simulate a value of null. I am running
into exactly same problem as yours where I cant make paramter optional as
Report Manager forces me to choose a value although I have defined null and
blank as options for the parameter.
TIA
"TomT" wrote:
> Lev, thanks, I was assuming if no choice was made (drop down blank) a null
> would be passed. I fixed it up to provide a value simulating a null
> situation, and it now works fine.
> Thanks for your quick response...
> Tom
> "Lev Semenets [MSFT]" wrote:
> > If Salesperson parameter uses available values from query, then the query
> > must return null or blank as one of available values.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "TomT" <tomt@.newsgroup.nospam> wrote in message
> > news:87D78917-4603-4339-AD5B-C4C3377BA9AA@.microsoft.com...
> > >I have a report based on a stored procedure with three parameters: Start
> > > Date, End Date, and Salesperson.
> > >
> > > The first two are required, and the Salesperson is not. In the report, the
> > > Salesperson is based on a query which provides a drop down for choosing a
> > > name. It is set to allow nulls and blanks.
> > >
> > > When I run the report in Visual Studio preview, if no Salesperson is
> > > chosen,
> > > and both dates are entered, no data is returned. Doing the same thing via
> > > debug in a browser, (the drop down is not blank, but says <Selelct a
> > > value>),
> > > I get prompted to supply the Salesperson parameter.
> > >
> > > Supplying a value for Salesperson in both cases works fine, but I want the
> > > user to have the option to get all the data, not just for a particular
> > > person. I've covered this case in the stored procedure, so I'm not sure
> > > what
> > > is getting passed in the previewer when nothing is entered and no data is
> > > returned.
> > >
> > > If I run the query (sp) via the Data tab, and provide exactly the same
> > > values for the parameters, I get the data I expect, and no prompt for the
> > > Salesperson.
> > >
> > > If I put a default value in for the Salesperson, (non-queried), e.g.
> > > "All",
> > > the preview in VS goes crazy, and locks up.
> > >
> > > I would have thought with allowing nulls and/or blanks, this should work.
> > > Am
> > > I missing something?
> > >
> > > Thanks for any help,
> > >
> > > Tom
> >
> >
> >|||TomT
Could you please tell me how did you simulate a value of null. I am running
into exactly same problem as yours where I cant make paramter optional as
Report Manager forces me to choose a value although I have defined null and
blank as options for the parameter.
TIA
"TomT" wrote:
> I have a report based on a stored procedure with three parameters: Start
> Date, End Date, and Salesperson.
> The first two are required, and the Salesperson is not. In the report, the
> Salesperson is based on a query which provides a drop down for choosing a
> name. It is set to allow nulls and blanks.
> When I run the report in Visual Studio preview, if no Salesperson is chosen,
> and both dates are entered, no data is returned. Doing the same thing via
> debug in a browser, (the drop down is not blank, but says <Selelct a value>),
> I get prompted to supply the Salesperson parameter.
> Supplying a value for Salesperson in both cases works fine, but I want the
> user to have the option to get all the data, not just for a particular
> person. I've covered this case in the stored procedure, so I'm not sure what
> is getting passed in the previewer when nothing is entered and no data is
> returned.
> If I run the query (sp) via the Data tab, and provide exactly the same
> values for the parameters, I get the data I expect, and no prompt for the
> Salesperson.
> If I put a default value in for the Salesperson, (non-queried), e.g. "All",
> the preview in VS goes crazy, and locks up.
> I would have thought with allowing nulls and/or blanks, this should work. Am
> I missing something?
> Thanks for any help,
> Tom|||Did you set default value for the parameter?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"tiwanap" <tiwanap@.discussions.microsoft.com> wrote in message
news:7C84F377-9ECA-4A87-AC8F-E936353B917A@.microsoft.com...
> TomT
> Could you please tell me how did you simulate a value of null. I am
> running
> into exactly same problem as yours where I cant make paramter optional as
> Report Manager forces me to choose a value although I have defined null
> and
> blank as options for the parameter.
> TIA
> "TomT" wrote:
>> I have a report based on a stored procedure with three parameters: Start
>> Date, End Date, and Salesperson.
>> The first two are required, and the Salesperson is not. In the report,
>> the
>> Salesperson is based on a query which provides a drop down for choosing a
>> name. It is set to allow nulls and blanks.
>> When I run the report in Visual Studio preview, if no Salesperson is
>> chosen,
>> and both dates are entered, no data is returned. Doing the same thing via
>> debug in a browser, (the drop down is not blank, but says <Selelct a
>> value>),
>> I get prompted to supply the Salesperson parameter.
>> Supplying a value for Salesperson in both cases works fine, but I want
>> the
>> user to have the option to get all the data, not just for a particular
>> person. I've covered this case in the stored procedure, so I'm not sure
>> what
>> is getting passed in the previewer when nothing is entered and no data is
>> returned.
>> If I run the query (sp) via the Data tab, and provide exactly the same
>> values for the parameters, I get the data I expect, and no prompt for the
>> Salesperson.
>> If I put a default value in for the Salesperson, (non-queried), e.g.
>> "All",
>> the preview in VS goes crazy, and locks up.
>> I would have thought with allowing nulls and/or blanks, this should work.
>> Am
>> I missing something?
>> Thanks for any help,
>> Tom

No comments:

Post a Comment