Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Thursday, March 29, 2012

Boolean Report Parameters

Hi, I have created a report parameter using a Boolean data type.

When I preview my Report I can select either True or False for this parameter. Is there any way of changing the 'True' label to say something else and again the same with the 'False' label?

Click on Report-Parameters

Select your parameter and go down to Available Values

Type in a label and the value

ex.

Open - True

Closed - False

Simone

|||This brings the values up in a list box, I was hoping to keep the selection as tick boxes but amend 'True' to say 'Open' for example.|||

I ran into the same issue today when I tried to change "String" parameter to "Boolean", and hoping to have radiobox instead of listbox dropdown.

No good, it'd be boolean type with dropdown, which is the same as "String" type essentially

It'd be nice to able to change label for "True" and "False"

Boolean report parameter with Yes/No choice list

SSRS 2005
In the Report Designer you can specify a Boolean report parameter with a
list of values. When the report is viewed on the Preview tab, the dropdown
list is rendered for the parameter instead of the usual True/False radio
buttons.
However, when the report is run on the Report Server, the same report
parameter is rendered with the usual True/False radio buttons and the defined
list is ignored.
Is this a bug in Report Designer, Report Server or both? Are there plans to
fix one of these so at least the behavior is consistent?
--
Chris, SSSIHello Chris,
I have reproduced this issue.
I am contacting the product team to check whether there is any fix or
workaround for this issue. I appreciate your patience.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei,
Any update on a fix or workaround for this?
--
Chris, SSSI
"Wei Lu [MSFT]" wrote:
> Hello Chris,
> I have reproduced this issue.
> I am contacting the product team to check whether there is any fix or
> workaround for this issue. I appreciate your patience.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello Chris,
The product team is still look into this. I will update any information
ASAP.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Chris,
After a long discussion with internal product team, this issue has a
workaround:
Use a string parameter with a Valid Values list instead.
Hope this will be helpful.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Boolean parameters

Hello,
I'm creating a boolean parameter in Report Designer and set {Label = "Yes",
Value = True} and {Label = "No", Value = False}. Then on Preview Page I see
to radio buttons, the first one is labeled "true" and the other one is
"false". Is this a bug? Can I set the labels I want to this radio buttons?This is a known limitation and scheduled to be addressed in a future
release.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
news:%23z6nV3BZEHA.3844@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I'm creating a boolean parameter in Report Designer and set {Label ="Yes",
> Value = True} and {Label = "No", Value = False}. Then on Preview Page I
see
> to radio buttons, the first one is labeled "true" and the other one is
> "false". Is this a bug? Can I set the labels I want to this radio buttons?
>|||Changing this behavior, for Booleans, is on our wish list for inclusion in a
future release.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lesha Akulinin" <leshaakulinin@.mail.ru> wrote in message
news:%23z6nV3BZEHA.3844@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I'm creating a boolean parameter in Report Designer and set {Label ="Yes",
> Value = True} and {Label = "No", Value = False}. Then on Preview Page I
see
> to radio buttons, the first one is labeled "true" and the other one is
> "false". Is this a bug? Can I set the labels I want to this radio buttons?
>

Boolean parameter label

Hi all..
I have a parameter of type Boolean. The available values are non-queried
with labels 'YES' and 'NO' and the values are obviously True and False,
respectively. When the report renders, I get the two option buttons, but the
labels are 'true' and 'false'. What did I miss?
--
Michael White
Programmer/Analyst
Marion County, ORIIRC available values and labels are not applicable in case of boolean
parameter.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael" <xxx.xxx.xxx> wrote in message
news:%2311IFe5ZFHA.3224@.TK2MSFTNGP10.phx.gbl...
> Hi all..
> I have a parameter of type Boolean. The available values are non-queried
> with labels 'YES' and 'NO' and the values are obviously True and False,
> respectively. When the report renders, I get the two option buttons, but
> the
> labels are 'true' and 'false'. What did I miss?
> --
> Michael White
> Programmer/Analyst
> Marion County, OR
>sql

Boolean parameter default issue on report server

Hi Folks,
I have a report with a boolean parameter(Show Reversed Invoices). I default
it to 'No' and this works in the BIDS environment just as i want with a drop
down menu, when deployed to the reportserver it renders as True/False radio
buttons however, the False radio button is not automatically checked. What am
I missing in order to have this happen?
Thanks for your help.On Nov 3, 2:07 pm, Stevie <Ste...@.discussions.microsoft.com> wrote:
> Hi Folks,
> I have a report with a boolean parameter(Show Reversed Invoices). I default
> it to 'No' and this works in the BIDS environment just as i want with a drop
> down menu, when deployed to the reportserver it renders as True/False radio
> buttons however, the False radio button is not automatically checked. What am
> I missing in order to have this happen?
> Thanks for your help.
When you say you set the default to 'No', do you mean 'False'? If not,
you will want to change the default value to False. If so, you may
want to check the Service Pack level of SQL Server on the Report
Server, it may not be the latest and you may need to get the latest
service pack for your version of SQL Server (if SQL 2005, SP2). Hope
this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi Enrique,
Thanks for responding. I just spoke to my manager about the service pack
level and he said we're at SP1+ and that we're going to SP2 soon. Once we get
there I'll let you know the results thereafter.
Best regards
"EMartinez" wrote:
> On Nov 3, 2:07 pm, Stevie <Ste...@.discussions.microsoft.com> wrote:
> > Hi Folks,
> >
> > I have a report with a boolean parameter(Show Reversed Invoices). I default
> > it to 'No' and this works in the BIDS environment just as i want with a drop
> > down menu, when deployed to the reportserver it renders as True/False radio
> > buttons however, the False radio button is not automatically checked. What am
> > I missing in order to have this happen?
> >
> > Thanks for your help.
>
> When you say you set the default to 'No', do you mean 'False'? If not,
> you will want to change the default value to False. If so, you may
> want to check the Service Pack level of SQL Server on the Report
> Server, it may not be the latest and you may need to get the latest
> service pack for your version of SQL Server (if SQL 2005, SP2). Hope
> this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On Nov 5, 9:05 am, Stevie <Ste...@.discussions.microsoft.com> wrote:
> Hi Enrique,
> Thanks for responding. I just spoke to my manager about the service pack
> level and he said we're at SP1+ and that we're going to SP2 soon. Once we get
> there I'll let you know the results thereafter.
> Best regards
> "EMartinez" wrote:
> > On Nov 3, 2:07 pm, Stevie <Ste...@.discussions.microsoft.com> wrote:
> > > Hi Folks,
> > > I have a report with a boolean parameter(Show Reversed Invoices). I default
> > > it to 'No' and this works in the BIDS environment just as i want with a drop
> > > down menu, when deployed to the reportserver it renders as True/False radio
> > > buttons however, the False radio button is not automatically checked. What am
> > > I missing in order to have this happen?
> > > Thanks for your help.
> > When you say you set the default to 'No', do you mean 'False'? If not,
> > you will want to change the default value to False. If so, you may
> > want to check the Service Pack level of SQL Server on the Report
> > Server, it may not be the latest and you may need to get the latest
> > service pack for your version of SQL Server (if SQL 2005, SP2). Hope
> > this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. Let me know if I can be of further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant|||It doesn't seem to be a Service Pack problem. I encountered the same exact
problem on SQL 2000 SP4. Oddly enough, my report had two boolean parameters,
the first of which defaulted correctly on the published Reporting Services
site, and the second did not (however, both worked fine in the Visual Studio
developer environment).
I was able to workaround the problem by renaming the parameter. At that
point, everything started working fine.
"EMartinez" wrote:
> On Nov 5, 9:05 am, Stevie <Ste...@.discussions.microsoft.com> wrote:
> > Hi Enrique,
> >
> > Thanks for responding. I just spoke to my manager about the service pack
> > level and he said we're at SP1+ and that we're going to SP2 soon. Once we get
> > there I'll let you know the results thereafter.
> >
> > Best regards
> >
> > "EMartinez" wrote:
> > > On Nov 3, 2:07 pm, Stevie <Ste...@.discussions.microsoft.com> wrote:
> > > > Hi Folks,
> >
> > > > I have a report with a boolean parameter(Show Reversed Invoices). I default
> > > > it to 'No' and this works in the BIDS environment just as i want with a drop
> > > > down menu, when deployed to the reportserver it renders as True/False radio
> > > > buttons however, the False radio button is not automatically checked. What am
> > > > I missing in order to have this happen?
> >
> > > > Thanks for your help.
> >
> > > When you say you set the default to 'No', do you mean 'False'? If not,
> > > you will want to change the default value to False. If so, you may
> > > want to check the Service Pack level of SQL Server on the Report
> > > Server, it may not be the latest and you may need to get the latest
> > > service pack for your version of SQL Server (if SQL 2005, SP2). Hope
> > > this helps.
> >
> > > Regards,
> >
> > > Enrique Martinez
> > > Sr. Software Consultant
>
> You're welcome. Let me know if I can be of further assistance.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Boolean Parameter

Hi,

I have a Summary report and a Detail (drillthrough) report.

the summary report displays.

Summary report

Code Snippet

Adult | Male | Count

--

Yes | Yes | 50

Yes | No | 9

No | Yes | 20

No | No | 50

| 129

When the user clicks on the hightlighted count it links to the Details report displaying each of the records referenced.

The detail report uses 2 boolean parameters Adult & Male, this works perfectly for the first 4 lines displayed, however if the user clicks on the total value to display all the records, i'm unable to provide the NULL value.

Any ideas?

Hi,

This may be due to the way you pass parameters to the sub-report.

you may not get answers if you are not more specific.

How is the total item generated. Why use a NULL value instead of something like "ALL" or "%" when the user select the total.

This may be easier to catch in the sub or linked report, the sub report will easilly interpret LIKE '%' rather than some NULL value.

Please provide some more details.

Philippe

|||

Hi,

The report queries against a database field that is a boolean but can accept a NULL value.

So i configured the recieving report to accept a boolean value "True, False & also Null".

If i used LIKE as the where criteria it obviously wouldn't be as efficent.

Regards

Ian

|||

What about using a dropdown param (whether multi select or not, depending on your needs) rather than a boolean here? Provide a tinyint to your procedure, if you're using a procedure to receive the parameter values, in which one value (say, 2) represents null. Interpret the results of what you get as this parameter to build up your query -- you could interpret it as an IN() rather than as a LIKE, or as ORs if you prefer (although the ORs are probably going to be interpreted internally just like the IN).

One really good way to do this is to use ISNULL(TheField,2) in your WHERE condition...

The point is, the default parameter representation for booleans with those radio buttons (with or without null checkbox) is hokey to start with, why not just use a dropdown with labels you like to represent them and integer values underneath.

>L<

|||

Hi Lisa,

Thank you for your input, that sounds like the way that i should have done it. i'll check out the dropdown options.

i would like a rant about the SRS report and boolean parameter at this stage....however i don't have the time or anyone else the want to read it. lol

cheers everyone.

ian

|||>> would like a rant about the SRS report and boolean parameter

I have done this before and generally don't care whether anybody wants to read it when I'm in the mood to rant on this sort of topic -- although I blog the rant rather than posting to a forum in that case <g>.

In this case, I honestly think the rant would be misdirected. As I have said several times in posts on this forum (because it is NOT a rant <s>), the default parameter representation is just that: a default. You can hide this panel, present your own parameter interface, and pass params to the report. I think this is always what was intended. The default just had to be generic enough to work without any sort of business logic connection and was never expected to be "the interface that you presented in your polished application".

>L<

Boolean Parameter

Hi,

I have a Summary report and a Detail (drillthrough) report.

the summary report displays.

Summary report

Code Snippet

Adult | Male | Count

--

Yes | Yes | 50

Yes | No | 9

No | Yes | 20

No | No | 50

| 129

When the user clicks on the hightlighted count it links to the Details report displaying each of the records referenced.

The detail report uses 2 boolean parameters Adult & Male, this works perfectly for the first 4 lines displayed, however if the user clicks on the total value to display all the records, i'm unable to provide the NULL value.

Any ideas?

Hi,

This may be due to the way you pass parameters to the sub-report.

you may not get answers if you are not more specific.

How is the total item generated. Why use a NULL value instead of something like "ALL" or "%" when the user select the total.

This may be easier to catch in the sub or linked report, the sub report will easilly interpret LIKE '%' rather than some NULL value.

Please provide some more details.

Philippe

|||

Hi,

The report queries against a database field that is a boolean but can accept a NULL value.

So i configured the recieving report to accept a boolean value "True, False & also Null".

If i used LIKE as the where criteria it obviously wouldn't be as efficent.

Regards

Ian

|||

What about using a dropdown param (whether multi select or not, depending on your needs) rather than a boolean here? Provide a tinyint to your procedure, if you're using a procedure to receive the parameter values, in which one value (say, 2) represents null. Interpret the results of what you get as this parameter to build up your query -- you could interpret it as an IN() rather than as a LIKE, or as ORs if you prefer (although the ORs are probably going to be interpreted internally just like the IN).

One really good way to do this is to use ISNULL(TheField,2) in your WHERE condition...

The point is, the default parameter representation for booleans with those radio buttons (with or without null checkbox) is hokey to start with, why not just use a dropdown with labels you like to represent them and integer values underneath.

>L<

|||

Hi Lisa,

Thank you for your input, that sounds like the way that i should have done it. i'll check out the dropdown options.

i would like a rant about the SRS report and boolean parameter at this stage....however i don't have the time or anyone else the want to read it. lol

cheers everyone.

ian

|||>> would like a rant about the SRS report and boolean parameter

I have done this before and generally don't care whether anybody wants to read it when I'm in the mood to rant on this sort of topic -- although I blog the rant rather than posting to a forum in that case <g>.

In this case, I honestly think the rant would be misdirected. As I have said several times in posts on this forum (because it is NOT a rant <s>), the default parameter representation is just that: a default. You can hide this panel, present your own parameter interface, and pass params to the report. I think this is always what was intended. The default just had to be generic enough to work without any sort of business logic connection and was never expected to be "the interface that you presented in your polished application".

>L<

Boolean Parameter

Hi,

I have a Summary report and a Detail (drillthrough) report.

the summary report displays.

Summary report

Code Snippet

Adult | Male | Count

--

Yes | Yes | 50

Yes | No | 9

No | Yes | 20

No | No | 50

| 129

When the user clicks on the hightlighted count it links to the Details report displaying each of the records referenced.

The detail report uses 2 boolean parameters Adult & Male, this works perfectly for the first 4 lines displayed, however if the user clicks on the total value to display all the records, i'm unable to provide the NULL value.

Any ideas?

Hi,

This may be due to the way you pass parameters to the sub-report.

you may not get answers if you are not more specific.

How is the total item generated. Why use a NULL value instead of something like "ALL" or "%" when the user select the total.

This may be easier to catch in the sub or linked report, the sub report will easilly interpret LIKE '%' rather than some NULL value.

Please provide some more details.

Philippe

|||

Hi,

The report queries against a database field that is a boolean but can accept a NULL value.

So i configured the recieving report to accept a boolean value "True, False & also Null".

If i used LIKE as the where criteria it obviously wouldn't be as efficent.

Regards

Ian

|||

What about using a dropdown param (whether multi select or not, depending on your needs) rather than a boolean here? Provide a tinyint to your procedure, if you're using a procedure to receive the parameter values, in which one value (say, 2) represents null. Interpret the results of what you get as this parameter to build up your query -- you could interpret it as an IN() rather than as a LIKE, or as ORs if you prefer (although the ORs are probably going to be interpreted internally just like the IN).

One really good way to do this is to use ISNULL(TheField,2) in your WHERE condition...

The point is, the default parameter representation for booleans with those radio buttons (with or without null checkbox) is hokey to start with, why not just use a dropdown with labels you like to represent them and integer values underneath.

>L<

|||

Hi Lisa,

Thank you for your input, that sounds like the way that i should have done it. i'll check out the dropdown options.

i would like a rant about the SRS report and boolean parameter at this stage....however i don't have the time or anyone else the want to read it. lol

cheers everyone.

ian

|||>> would like a rant about the SRS report and boolean parameter

I have done this before and generally don't care whether anybody wants to read it when I'm in the mood to rant on this sort of topic -- although I blog the rant rather than posting to a forum in that case <g>.

In this case, I honestly think the rant would be misdirected. As I have said several times in posts on this forum (because it is NOT a rant <s>), the default parameter representation is just that: a default. You can hide this panel, present your own parameter interface, and pass params to the report. I think this is always what was intended. The default just had to be generic enough to work without any sort of business logic connection and was never expected to be "the interface that you presented in your polished application".

>L<

Thursday, March 22, 2012

Bookmark Functionality and HTMLFragment

I have a report displayed within a frame. A different frame in the
frameset is posting parameter values to this report display frame.
The bookmarks on the report do not work when displayed within the
frame. The onclick javascript command is not created for the
bookmarks.
I have the following HTML configuration settings:
Format = HTML4.0
Toolbar = False
Parameters = False
HTMLFragment = True
If I set the HTMLFragment = false, the bookmarks work, but my
subreports are not rendered in IE (but the subreports are rendered in
Firefox), instead I get the typical red X indicative of a missing
image.
When I view the report via Report Manager, the bookmarks work
correctly. When I include the toolbar on the report, the bookmarks
work correctly (and I see the bookmark onclick code generated when I
view the source of the report).
Any help appreciated.The bookmarks will not work in fragment mode as the content is expected to
be inserted in another document. You shouldn't need fragment mode for the
frame. As for why the subreports are not showing, I don't understand why
(especially if you say it works in Firefox). Do you mean images? Subreports
are never replaced with a red X.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Potter" <drewpotter@.gmail.com> wrote in message
news:1115943049.364352.197320@.g49g2000cwa.googlegroups.com...
>I have a report displayed within a frame. A different frame in the
> frameset is posting parameter values to this report display frame.
> The bookmarks on the report do not work when displayed within the
> frame. The onclick javascript command is not created for the
> bookmarks.
> I have the following HTML configuration settings:
> Format = HTML4.0
> Toolbar = False
> Parameters = False
> HTMLFragment = True
> If I set the HTMLFragment = false, the bookmarks work, but my
> subreports are not rendered in IE (but the subreports are rendered in
> Firefox), instead I get the typical red X indicative of a missing
> image.
> When I view the report via Report Manager, the bookmarks work
> correctly. When I include the toolbar on the report, the bookmarks
> work correctly (and I see the bookmark onclick code generated when I
> view the source of the report).
> Any help appreciated.
>

Monday, March 19, 2012

Body is overlapping header

Hello~
I have a report with a header and body.
The header has the usual stuff, title, logo, parameter fields, etc
The body is a table.
When I run the report, the table overlaps the header... I don't
understand why this is happening...
So... what I'm doing right now is I have to leave an inch of blank
space just before the table in the body. But cosmetically the report
doesnt look right...
Thanks!On Jul 12, 4:55 pm, OogleGoogle <Yvonh...@.gmail.com> wrote:
> Hello~
> I have a report with a header and body.
> The header has the usual stuff, title, logo, parameter fields, etc
> The body is a table.
> When I run the report, the table overlaps the header... I don't
> understand why this is happening...
> So... what I'm doing right now is I have to leave an inch of blank
> space just before the table in the body. But cosmetically the report
> doesnt look right...
> Thanks!
This seems like a unique situation. I would suggest putting the
contents of the header into one rectangle and doing the same for the
table control in the body. Also, you might want to right-click inside
the blank area of the header -> select Properties -> and increase the
BorderWidth. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||On Jul 12, 9:40 pm, EMartinez <emartinez...@.gmail.com> wrote:
> On Jul 12, 4:55 pm, OogleGoogle <Yvonh...@.gmail.com> wrote:
> > Hello~
> > I have a report with a header and body.
> > The header has the usual stuff, title, logo, parameter fields, etc
> > The body is a table.
> > When I run the report, the table overlaps the header... I don't
> > understand why this is happening...
> > So... what I'm doing right now is I have to leave an inch of blank
> > space just before the table in the body. But cosmetically the report
> > doesnt look right...
> > Thanks!
> This seems like a unique situation. I would suggest putting the
> contents of the header into one rectangle and doing the same for the
> table control in the body. Also, you might want to right-click inside
> the blank area of the header -> select Properties -> and increase the
> BorderWidth. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
Under the properties tab for the report itself, try changing the
margins it may or may not help.

Thursday, March 8, 2012

Blocking and return parameters

Is it possible the existence of a return parameter on an SP running
insert statements would cause blocking to happen (any removing it
might help eliminate it?)
The SPs in question have three INSERT INTO statements using an
@.@.IDENTITY to help populate the second and third tables based on the
PK of the newly inserted record in the first INSERT INTO Statement.
I have recently stared to receive timeout errors in a multi-user
enviroment and wonder if that's part of the cause. In this
environment, users are requerying a table that is also being written
to. The writes are infrequent but the reads of that table are very
frequent.
On the read side I have added Select from TableX WITH (READPAST)...
On the write side I have elimnated the return parameters. I'm hoping
these two approaches help.
Help is greatly appreciated.
lq"Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
news:47e5bd72.0404110746.4de8d6d7@.posting.google.c om...
> Is it possible the existence of a return parameter on an SP running
> insert statements would cause blocking to happen (any removing it
> might help eliminate it?)
> The SPs in question have three INSERT INTO statements using an
> @.@.IDENTITY to help populate the second and third tables based on the
> PK of the newly inserted record in the first INSERT INTO Statement.
> I have recently stared to receive timeout errors in a multi-user
> enviroment and wonder if that's part of the cause. In this
> environment, users are requerying a table that is also being written
> to. The writes are infrequent but the reads of that table are very
> frequent.
> On the read side I have added Select from TableX WITH (READPAST)...
> On the write side I have elimnated the return parameters. I'm hoping
> these two approaches help.
> Help is greatly appreciated.
> lq

I'm not entirely sure I follow your description - stored procedures can have
return values, and output parameters, but not "return parameters" so I'm not
clear as to which one you mean here.

As a general comment, if your three INSERTs are inside a transaction, and
that transaction runs for too long, or requires a lot of locks, then it's
possible that the readers will be affected. But without some more
information, such as the piece of code containing the INSERTs, and some
background information about the tables, it's hard to say.

By the way, READPAST is potentially dangerous, because it means the client
will not see data which it should normally see, so the results returned may
be incomplete. Locking hints are not often required, so you should try other
solutions first.

Simon|||"Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
news:47e5bd72.0404110746.4de8d6d7@.posting.google.c om...
> Is it possible the existence of a return parameter on an SP running
> insert statements would cause blocking to happen (any removing it
> might help eliminate it?)
> The SPs in question have three INSERT INTO statements using an
> @.@.IDENTITY to help populate the second and third tables based on the
> PK of the newly inserted record in the first INSERT INTO Statement.
> I have recently stared to receive timeout errors in a multi-user
> enviroment and wonder if that's part of the cause. In this
> environment, users are requerying a table that is also being written
> to. The writes are infrequent but the reads of that table are very
> frequent.
> On the read side I have added Select from TableX WITH (READPAST)...
> On the write side I have elimnated the return parameters. I'm hoping
> these two approaches help.
> Help is greatly appreciated.
> lq

I'm not entirely sure I follow your description - stored procedures can have
return values, and output parameters, but not "return parameters" so I'm not
clear as to which one you mean here.

As a general comment, if your three INSERTs are inside a transaction, and
that transaction runs for too long, or requires a lot of locks, then it's
possible that the readers will be affected. But without some more
information, such as the piece of code containing the INSERTs, and some
background information about the tables, it's hard to say.

By the way, READPAST is potentially dangerous, because it means the client
will not see data which it should normally see, so the results returned may
be incomplete. Locking hints are not often required, so you should try other
solutions first.

Simon|||Simon,
Thank you for your response. I meant to write that in VBA I have
appended an Output Parameters to the prm collection.

Here is the entire SP:

*** START SP CODE:

Alter Procedure "mySPName"
@.par1 nvarchar(15) = null,
@.par2 int = null,
@.par3 nvarchar(50) = null,
@.par4 nvarchar(50) = null,
@.par5 nvarchar(125) = null,
@.par6 smallint = null,
@.par7 ntext = null,
@.par8 smalldatetime = null,
@.par9 smalldatetime = null,
@.par10 smalldatetime = null,
@.par11 smalldatetime = null,
@.par12 datetime = null,
@.par13 datetime = null,
@.par14 smallint = null,
@.par15 smalldatetime = null,
@.par16 tinyint = null,
@.par17 tinyint = null,
@.par18 tinyint = null,
@.par19 nvarchar(100) = null,
@.par20 int = null,
@.par21 int = null,
@.par22 int = null,
@.PKID int OUTPUT

AS
set nocount on
set xact_abort on

/* Insert new event into tblAppointments */

INSERT INTO
tblAppointments (fld1, fld2, fld3, fld4, fld5, fld6, fld7, fld8,
fld9, fld10, fld11, fld12, fld13, fld14, fld15, fld16, fld17, fld18,
fld19, fld20, fld21,fld22,fld23, fld24)
VALUES
(@.par1, @.par2, @.par3, @.par4, @.par5, @.par6, @.par7,
@.par8, @.par9, @.par10, @.par12,@.par13, @.par14, @.par15, @.par16, @.par17,
@.par18,
@.par19, @.par20, @.par21,@.par22, @.par22,@.par18, @.par18)

/* Note: Some columns above receive data from the same parameters */

SELECT @.PKID = @.@.IDENTITY

/* Create an entry in tblAppointmentHistory */

Insert Into
tblAppointmentsHistory (fldA, fldB, fldC, fldD, fldE)
Values
(@.PKID, @.par2, @.par3,'New Entry','Appt Type = ' + @.par4 + ' ;
AppTitle= ' + @.par5 + ' ; AppDescription= ' + isnull(Cast(@.par7 AS
nvarchar(4000)),'<none>') + ' ; Location = ' + @.par19 + ' ; Start
Date = ' + CAST(@.par12 AS nvarchar(25)) + ' ; End Date = ' +
IsNull(CAST(@.par13 AS nvarchar(25)),'<none'))

***END SP CODE

"Simon Hayes" <sql@.hayes.ch> wrote in message news:<407af642$1_2@.news.bluewin.ch>...
> "Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
> news:47e5bd72.0404110746.4de8d6d7@.posting.google.c om...
> > Is it possible the existence of a return parameter on an SP running
> > insert statements would cause blocking to happen (any removing it
> > might help eliminate it?)
> > The SPs in question have three INSERT INTO statements using an
> > @.@.IDENTITY to help populate the second and third tables based on the
> > PK of the newly inserted record in the first INSERT INTO Statement.
> > I have recently stared to receive timeout errors in a multi-user
> > enviroment and wonder if that's part of the cause. In this
> > environment, users are requerying a table that is also being written
> > to. The writes are infrequent but the reads of that table are very
> > frequent.
> > On the read side I have added Select from TableX WITH (READPAST)...
> > On the write side I have elimnated the return parameters. I'm hoping
> > these two approaches help.
> > Help is greatly appreciated.
> > lq
> I'm not entirely sure I follow your description - stored procedures can have
> return values, and output parameters, but not "return parameters" so I'm not
> clear as to which one you mean here.
> As a general comment, if your three INSERTs are inside a transaction, and
> that transaction runs for too long, or requires a lot of locks, then it's
> possible that the readers will be affected. But without some more
> information, such as the piece of code containing the INSERTs, and some
> background information about the tables, it's hard to say.
> By the way, READPAST is potentially dangerous, because it means the client
> will not see data which it should normally see, so the results returned may
> be incomplete. Locking hints are not often required, so you should try other
> solutions first.
> Simon|||Simon,
Thank you for your response. I meant to write that in VBA I have
appended an Output Parameters to the prm collection.

Here is the entire SP:

*** START SP CODE:

Alter Procedure "mySPName"
@.par1 nvarchar(15) = null,
@.par2 int = null,
@.par3 nvarchar(50) = null,
@.par4 nvarchar(50) = null,
@.par5 nvarchar(125) = null,
@.par6 smallint = null,
@.par7 ntext = null,
@.par8 smalldatetime = null,
@.par9 smalldatetime = null,
@.par10 smalldatetime = null,
@.par11 smalldatetime = null,
@.par12 datetime = null,
@.par13 datetime = null,
@.par14 smallint = null,
@.par15 smalldatetime = null,
@.par16 tinyint = null,
@.par17 tinyint = null,
@.par18 tinyint = null,
@.par19 nvarchar(100) = null,
@.par20 int = null,
@.par21 int = null,
@.par22 int = null,
@.PKID int OUTPUT

AS
set nocount on
set xact_abort on

/* Insert new event into tblAppointments */

INSERT INTO
tblAppointments (fld1, fld2, fld3, fld4, fld5, fld6, fld7, fld8,
fld9, fld10, fld11, fld12, fld13, fld14, fld15, fld16, fld17, fld18,
fld19, fld20, fld21,fld22,fld23, fld24)
VALUES
(@.par1, @.par2, @.par3, @.par4, @.par5, @.par6, @.par7,
@.par8, @.par9, @.par10, @.par12,@.par13, @.par14, @.par15, @.par16, @.par17,
@.par18,
@.par19, @.par20, @.par21,@.par22, @.par22,@.par18, @.par18)

/* Note: Some columns above receive data from the same parameters */

SELECT @.PKID = @.@.IDENTITY

/* Create an entry in tblAppointmentHistory */

Insert Into
tblAppointmentsHistory (fldA, fldB, fldC, fldD, fldE)
Values
(@.PKID, @.par2, @.par3,'New Entry','Appt Type = ' + @.par4 + ' ;
AppTitle= ' + @.par5 + ' ; AppDescription= ' + isnull(Cast(@.par7 AS
nvarchar(4000)),'<none>') + ' ; Location = ' + @.par19 + ' ; Start
Date = ' + CAST(@.par12 AS nvarchar(25)) + ' ; End Date = ' +
IsNull(CAST(@.par13 AS nvarchar(25)),'<none'))

***END SP CODE

"Simon Hayes" <sql@.hayes.ch> wrote in message news:<407af642$1_2@.news.bluewin.ch>...
> "Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
> news:47e5bd72.0404110746.4de8d6d7@.posting.google.c om...
> > Is it possible the existence of a return parameter on an SP running
> > insert statements would cause blocking to happen (any removing it
> > might help eliminate it?)
> > The SPs in question have three INSERT INTO statements using an
> > @.@.IDENTITY to help populate the second and third tables based on the
> > PK of the newly inserted record in the first INSERT INTO Statement.
> > I have recently stared to receive timeout errors in a multi-user
> > enviroment and wonder if that's part of the cause. In this
> > environment, users are requerying a table that is also being written
> > to. The writes are infrequent but the reads of that table are very
> > frequent.
> > On the read side I have added Select from TableX WITH (READPAST)...
> > On the write side I have elimnated the return parameters. I'm hoping
> > these two approaches help.
> > Help is greatly appreciated.
> > lq
> I'm not entirely sure I follow your description - stored procedures can have
> return values, and output parameters, but not "return parameters" so I'm not
> clear as to which one you mean here.
> As a general comment, if your three INSERTs are inside a transaction, and
> that transaction runs for too long, or requires a lot of locks, then it's
> possible that the readers will be affected. But without some more
> information, such as the piece of code containing the INSERTs, and some
> background information about the tables, it's hard to say.
> By the way, READPAST is potentially dangerous, because it means the client
> will not see data which it should normally see, so the results returned may
> be incomplete. Locking hints are not often required, so you should try other
> solutions first.
> Simon|||"Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
news:47e5bd72.0404121731.52fe5214@.posting.google.c om...
> Simon,
> Thank you for your response. I meant to write that in VBA I have
> appended an Output Parameters to the prm collection.
> Here is the entire SP:

<snip
At first glance, there doesn't seem to be anything obviously incorrect with
your procedure, assuming that you haven't removed anything significant from
it. Small issues are that you should probably use SCOPE_IDENTITY() instead
of @.@.IDENTITY (see Books Online), and you may want to review your use of SET
XACT_ABORT:

http://www.sommarskog.se/error-hand...html#XACT_ABORT

To go back to your original timeout issue, why do you think the timeouts are
connected to this specific procedure? Have you monitored what's happening on
the server when timeouts occur, especially locking? You can use Profiler to
capture what's happening on the server, and this KB article may be useful:

http://support.microsoft.com/defaul...9&Product=sql2k

Erland also has a tool for examining locks:

http://www.sommarskog.se/sqlutil/aba_lockinfo.html

Simon|||"Lauren Quantrell" <laurenquantrell@.hotmail.com> wrote in message
news:47e5bd72.0404121731.52fe5214@.posting.google.c om...
> Simon,
> Thank you for your response. I meant to write that in VBA I have
> appended an Output Parameters to the prm collection.
> Here is the entire SP:

<snip
At first glance, there doesn't seem to be anything obviously incorrect with
your procedure, assuming that you haven't removed anything significant from
it. Small issues are that you should probably use SCOPE_IDENTITY() instead
of @.@.IDENTITY (see Books Online), and you may want to review your use of SET
XACT_ABORT:

http://www.sommarskog.se/error-hand...html#XACT_ABORT

To go back to your original timeout issue, why do you think the timeouts are
connected to this specific procedure? Have you monitored what's happening on
the server when timeouts occur, especially locking? You can use Profiler to
capture what's happening on the server, and this KB article may be useful:

http://support.microsoft.com/defaul...9&Product=sql2k

Erland also has a tool for examining locks:

http://www.sommarskog.se/sqlutil/aba_lockinfo.html

Simon

Saturday, February 25, 2012

block a parameter

I have parametro call client, who is a list of clients, taken from the data
base to traves of a query, access the report through the URL, by means of
Internet to explorer, in some cases desire of passing parameter clients
already selected and who the user who is seeing the report cannot modify it,
As blockade the parameter?
--
ING. JOSE DAVID GALVIZ MUÑOZ
MCAD
DCE Tercera EstrellaHi Jose,
You can, either when designing the report or through Report Manager set the
parameter to No prompt. When you do this, the parameter will not be
displayed to the user, so the user will not be able to change the value.
-Lukasz
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"José David Galviz M" <joda_26@.hotmail.com> wrote in message
news:Okp1lnQcEHA.644@.tk2msftngp13.phx.gbl...
>I have parametro call client, who is a list of clients, taken from the data
> base to traves of a query, access the report through the URL, by means of
> Internet to explorer, in some cases desire of passing parameter clients
> already selected and who the user who is seeing the report cannot modify
> it,
> As blockade the parameter?
> --
> ING. JOSE DAVID GALVIZ MUÑOZ
> MCAD
> DCE Tercera Estrella
>|||Thanks
--
ING. JOSE DAVID GALVIZ MUÑOZ
MCAD
DCE Tercera Estrella
"Lukasz Pawlowski [MSFT]" <lukaszp@.online.microsoft.com> escribió en el
mensaje news:O%23bJnl1cEHA.1000@.TK2MSFTNGP12.phx.gbl...
> Hi Jose,
> You can, either when designing the report or through Report Manager set
the
> parameter to No prompt. When you do this, the parameter will not be
> displayed to the user, so the user will not be able to change the value.
> -Lukasz
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "José David Galviz M" <joda_26@.hotmail.com> wrote in message
> news:Okp1lnQcEHA.644@.tk2msftngp13.phx.gbl...
> >I have parametro call client, who is a list of clients, taken from the
data
> > base to traves of a query, access the report through the URL, by means
of
> > Internet to explorer, in some cases desire of passing parameter clients
> > already selected and who the user who is seeing the report cannot modify
> > it,
> > As blockade the parameter?
> >
> > --
> > ING. JOSE DAVID GALVIZ MUÑOZ
> > MCAD
> > DCE Tercera Estrella
> >
> >
>

Friday, February 24, 2012

Blank value when displaying parameter label

Hi,
I've got the following problem in a report:
I've got a parameter that i'm manually giving available values and labels.
When i'm trying to display this parameter's label into a tabcell
(Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
ReportManager).
Is there a way to fix this issue ?
Best Regards,
Grégory.Greg,
Are you trying to do this in report designer? Have you set a prompt string
for the report parameter on the report parameters dialog?
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Greg - NEOS" <GregNEOS@.discussions.microsoft.com> wrote in message
news:3B6D9848-7DBE-4B4D-B9EE-3B23B969ABAD@.microsoft.com...
> Hi,
> I've got the following problem in a report:
> I've got a parameter that i'm manually giving available values and labels.
> When i'm trying to display this parameter's label into a tabcell
> (Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
> ReportManager).
> Is there a way to fix this issue ?
> Best Regards,
> Grégory.|||Hi Lukasz,
Yes i'm trying to do this in the report designer. The result is identitical
once the report is deployed. And there is a prompt string for this particular
parameter.
Any idea ?
Thanks in advance.
Grégory.
"Lukasz Pawlowski [MSFT]" wrote:
> Greg,
> Are you trying to do this in report designer? Have you set a prompt string
> for the report parameter on the report parameters dialog?
> -Lukasz
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Greg - NEOS" <GregNEOS@.discussions.microsoft.com> wrote in message
> news:3B6D9848-7DBE-4B4D-B9EE-3B23B969ABAD@.microsoft.com...
> > Hi,
> >
> > I've got the following problem in a report:
> >
> > I've got a parameter that i'm manually giving available values and labels.
> > When i'm trying to display this parameter's label into a tabcell
> > (Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
> > ReportManager).
> >
> > Is there a way to fix this issue ?
> >
> > Best Regards,
> > Grégory.
>
>

Sunday, February 19, 2012

Blank Parameters do not work when running stored proc in Data view

I have a stored procedure that gives different outputs based on whether an
input parameter is given or not. When I set the parameter to blank, not
NULL, I assume this will give the same result as running it in Query Analyzer
and not inputting anything for that parameter, but instead I get a "input
string was not in the correct format" error. Is this a bug? It is not the
behavior I would expect. I think it is very important that blank parameters
work correctly.I'm talking about the parameters in a SQL Server stored procedure. When I
run the report, it's fine if I allow blank values, and there is no error.
Only in Data View do I get the error when I try to run it or do refresh
fields, and it asks me to input all parameters.
"Aaron Williams" wrote:
> Did you set the parameter to allow blank values?
> "Stefan Wrobel" wrote:
> > I have a stored procedure that gives different outputs based on whether an
> > input parameter is given or not. When I set the parameter to blank, not
> > NULL, I assume this will give the same result as running it in Query Analyzer
> > and not inputting anything for that parameter, but instead I get a "input
> > string was not in the correct format" error. Is this a bug? It is not the
> > behavior I would expect. I think it is very important that blank parameters
> > work correctly.|||That seems about correct. I assumed if you specified a parameter as blank it
was like not sending it to the SP at all. For clarification, I only need to
use 2 of the 4 parameters for the report, so I just deleted the 2 I didn't
need from the parameters list. I assume its as if the Report Server doesn't
even know these parameters exist, and doesn't attempt to set them to
anything. This is how I want it. However, in Data View, if I try to get the
fields in the first place, I have to give some sort of value for all 4
parameters, because if I leave the 2 I don't need set to <Blank>, I get that
error. The only time I ever have run into this problem is while designing
the Report, but not anywhere else. It works fine in Query Analyzer, and also
when I run the report through Report Server.
Actually, now that I think about it, to clarify, here's a simple example
that applies to 1 of the 2 parameters.
@.param1 int,
@.param2 int = @.param1
So basically if I don't specify anything for @.param2, it should just be
equal to what I specified for @.param1. However, there doesn't seem to be any
way in Data View not to specify anything. Leaving it set to <blank> I think
it still tries to set the parameter to something, and obviously to something
that causes an error.
I think that's about the best I can do to explain it. It's not like it
prevents me from using Reporting Services, but it is very annoying and seems
counterintuitive.
Thanks for your help.
"Aaron Williams" wrote:
> Could you provide an example of your stored proc?
> Lets make sure we're on the same page. If I get what you're saying, your
> stored proc allows you to send a parameter value if desired, but if you don't
> send anything, then it will still return a query. So your stored proc might
> look something like this:
> CREATE proc MyStoredProcedure
> @.MyParameter int = null
> AS
> SELECT * FROM MyTable
> WHERE (MyPrimaryKey = @.MyParameter OR @.MyParameter is NULL)
> In this case, you can run it in query analyzer like so:
> exec MyStoredProcedure 1 OR exec MyStoredProcedure ('blank')
> In this case, the first would return one record, and the second would return
> ALL records. So, if this is what you mean, then your problem is that when
> you try to pass a ' ' (blank value) to the report parameter you get an error.
> '
> -Aaron
>
> "Stefan Wrobel" wrote:
> > By the way, I'm speaking about when designing a report in Visual Studio
> >
> > "Stefan Wrobel" wrote:
> >
> > > I'm talking about the parameters in a SQL Server stored procedure. When I
> > > run the report, it's fine if I allow blank values, and there is no error.
> > > Only in Data View do I get the error when I try to run it or do refresh
> > > fields, and it asks me to input all parameters.
> > >
> > > "Aaron Williams" wrote:
> > >
> > > > Did you set the parameter to allow blank values?
> > > >
> > > > "Stefan Wrobel" wrote:
> > > >
> > > > > I have a stored procedure that gives different outputs based on whether an
> > > > > input parameter is given or not. When I set the parameter to blank, not
> > > > > NULL, I assume this will give the same result as running it in Query Analyzer
> > > > > and not inputting anything for that parameter, but instead I get a "input
> > > > > string was not in the correct format" error. Is this a bug? It is not the
> > > > > behavior I would expect. I think it is very important that blank parameters
> > > > > work correctly.|||Could you provide an example of your stored proc?
Lets make sure we're on the same page. If I get what you're saying, your
stored proc allows you to send a parameter value if desired, but if you don't
send anything, then it will still return a query. So your stored proc might
look something like this:
CREATE proc MyStoredProcedure
@.MyParameter int = null
AS
SELECT * FROM MyTable
WHERE (MyPrimaryKey = @.MyParameter OR @.MyParameter is NULL)
In this case, you can run it in query analyzer like so:
exec MyStoredProcedure 1 OR exec MyStoredProcedure ('blank')
In this case, the first would return one record, and the second would return
ALL records. So, if this is what you mean, then your problem is that when
you try to pass a ' ' (blank value) to the report parameter you get an error.
'
-Aaron
"Stefan Wrobel" wrote:
> By the way, I'm speaking about when designing a report in Visual Studio
> "Stefan Wrobel" wrote:
> > I'm talking about the parameters in a SQL Server stored procedure. When I
> > run the report, it's fine if I allow blank values, and there is no error.
> > Only in Data View do I get the error when I try to run it or do refresh
> > fields, and it asks me to input all parameters.
> >
> > "Aaron Williams" wrote:
> >
> > > Did you set the parameter to allow blank values?
> > >
> > > "Stefan Wrobel" wrote:
> > >
> > > > I have a stored procedure that gives different outputs based on whether an
> > > > input parameter is given or not. When I set the parameter to blank, not
> > > > NULL, I assume this will give the same result as running it in Query Analyzer
> > > > and not inputting anything for that parameter, but instead I get a "input
> > > > string was not in the correct format" error. Is this a bug? It is not the
> > > > behavior I would expect. I think it is very important that blank parameters
> > > > work correctly.|||I think the way you want it do it will really only work in Query Analyzer.
Reporting Services gets a list of all the parameters in the stored procedure
when you create the dataset. I assume you could do what you said and remove
the unnessisary parameters from the list, but then you no longer have the
option of using them which is obviously something you want to do.
Another option would be to change your stored procedure so that the optional
parameters can accept NULL's and then change the values later. That way
Reporting Services can send a null value to those parameters and you can
still use them the way you desire. Here's an example of how I would change
your stored proc so you can do what you're looking for.
CREATE proc Tmp_TestParams
@.param1 int,
@.param2 int = null,
@.param3 int = null
AS
-- Here's where you set the value of the blank parameters
IF @.param2 IS null
BEGIN
SET @.param2 = @.param1
END
IF @.param3 is null
BEGIN
SET @.param3 = @.param2
END
SELECT @.param1 as Param1, @.param2 as Param2, @.param3 as Param3
Go
exec Tmp_TestParams 1, null, null
Hope this helps!
-Aaron
"Stefan Wrobel" wrote:
> That seems about correct. I assumed if you specified a parameter as blank it
> was like not sending it to the SP at all. For clarification, I only need to
> use 2 of the 4 parameters for the report, so I just deleted the 2 I didn't
> need from the parameters list. I assume its as if the Report Server doesn't
> even know these parameters exist, and doesn't attempt to set them to
> anything. This is how I want it. However, in Data View, if I try to get the
> fields in the first place, I have to give some sort of value for all 4
> parameters, because if I leave the 2 I don't need set to <Blank>, I get that
> error. The only time I ever have run into this problem is while designing
> the Report, but not anywhere else. It works fine in Query Analyzer, and also
> when I run the report through Report Server.
> Actually, now that I think about it, to clarify, here's a simple example
> that applies to 1 of the 2 parameters.
> @.param1 int,
> @.param2 int = @.param1
> So basically if I don't specify anything for @.param2, it should just be
> equal to what I specified for @.param1. However, there doesn't seem to be any
> way in Data View not to specify anything. Leaving it set to <blank> I think
> it still tries to set the parameter to something, and obviously to something
> that causes an error.
> I think that's about the best I can do to explain it. It's not like it
> prevents me from using Reporting Services, but it is very annoying and seems
> counterintuitive.
> Thanks for your help.
> "Aaron Williams" wrote:
> > Could you provide an example of your stored proc?
> >
> > Lets make sure we're on the same page. If I get what you're saying, your
> > stored proc allows you to send a parameter value if desired, but if you don't
> > send anything, then it will still return a query. So your stored proc might
> > look something like this:
> >
> > CREATE proc MyStoredProcedure
> > @.MyParameter int = null
> >
> > AS
> >
> > SELECT * FROM MyTable
> > WHERE (MyPrimaryKey = @.MyParameter OR @.MyParameter is NULL)
> >
> > In this case, you can run it in query analyzer like so:
> >
> > exec MyStoredProcedure 1 OR exec MyStoredProcedure ('blank')
> >
> > In this case, the first would return one record, and the second would return
> > ALL records. So, if this is what you mean, then your problem is that when
> > you try to pass a ' ' (blank value) to the report parameter you get an error.
> > '
> >
> > -Aaron
> >
> >
> > "Stefan Wrobel" wrote:
> >
> > > By the way, I'm speaking about when designing a report in Visual Studio
> > >
> > > "Stefan Wrobel" wrote:
> > >
> > > > I'm talking about the parameters in a SQL Server stored procedure. When I
> > > > run the report, it's fine if I allow blank values, and there is no error.
> > > > Only in Data View do I get the error when I try to run it or do refresh
> > > > fields, and it asks me to input all parameters.
> > > >
> > > > "Aaron Williams" wrote:
> > > >
> > > > > Did you set the parameter to allow blank values?
> > > > >
> > > > > "Stefan Wrobel" wrote:
> > > > >
> > > > > > I have a stored procedure that gives different outputs based on whether an
> > > > > > input parameter is given or not. When I set the parameter to blank, not
> > > > > > NULL, I assume this will give the same result as running it in Query Analyzer
> > > > > > and not inputting anything for that parameter, but instead I get a "input
> > > > > > string was not in the correct format" error. Is this a bug? It is not the
> > > > > > behavior I would expect. I think it is very important that blank parameters
> > > > > > work correctly.|||Good suggestion, thanks!
"Aaron Williams" wrote:
> I think the way you want it do it will really only work in Query Analyzer.
> Reporting Services gets a list of all the parameters in the stored procedure
> when you create the dataset. I assume you could do what you said and remove
> the unnessisary parameters from the list, but then you no longer have the
> option of using them which is obviously something you want to do.
> Another option would be to change your stored procedure so that the optional
> parameters can accept NULL's and then change the values later. That way
> Reporting Services can send a null value to those parameters and you can
> still use them the way you desire. Here's an example of how I would change
> your stored proc so you can do what you're looking for.
> CREATE proc Tmp_TestParams
> @.param1 int,
> @.param2 int = null,
> @.param3 int = null
> AS
> -- Here's where you set the value of the blank parameters
> IF @.param2 IS null
> BEGIN
> SET @.param2 = @.param1
> END
> IF @.param3 is null
> BEGIN
> SET @.param3 = @.param2
> END
> SELECT @.param1 as Param1, @.param2 as Param2, @.param3 as Param3
> Go
> exec Tmp_TestParams 1, null, null
> Hope this helps!
> -Aaron
> "Stefan Wrobel" wrote:
> > That seems about correct. I assumed if you specified a parameter as blank it
> > was like not sending it to the SP at all. For clarification, I only need to
> > use 2 of the 4 parameters for the report, so I just deleted the 2 I didn't
> > need from the parameters list. I assume its as if the Report Server doesn't
> > even know these parameters exist, and doesn't attempt to set them to
> > anything. This is how I want it. However, in Data View, if I try to get the
> > fields in the first place, I have to give some sort of value for all 4
> > parameters, because if I leave the 2 I don't need set to <Blank>, I get that
> > error. The only time I ever have run into this problem is while designing
> > the Report, but not anywhere else. It works fine in Query Analyzer, and also
> > when I run the report through Report Server.
> >
> > Actually, now that I think about it, to clarify, here's a simple example
> > that applies to 1 of the 2 parameters.
> >
> > @.param1 int,
> > @.param2 int = @.param1
> >
> > So basically if I don't specify anything for @.param2, it should just be
> > equal to what I specified for @.param1. However, there doesn't seem to be any
> > way in Data View not to specify anything. Leaving it set to <blank> I think
> > it still tries to set the parameter to something, and obviously to something
> > that causes an error.
> >
> > I think that's about the best I can do to explain it. It's not like it
> > prevents me from using Reporting Services, but it is very annoying and seems
> > counterintuitive.
> >
> > Thanks for your help.
> >
> > "Aaron Williams" wrote:
> >
> > > Could you provide an example of your stored proc?
> > >
> > > Lets make sure we're on the same page. If I get what you're saying, your
> > > stored proc allows you to send a parameter value if desired, but if you don't
> > > send anything, then it will still return a query. So your stored proc might
> > > look something like this:
> > >
> > > CREATE proc MyStoredProcedure
> > > @.MyParameter int = null
> > >
> > > AS
> > >
> > > SELECT * FROM MyTable
> > > WHERE (MyPrimaryKey = @.MyParameter OR @.MyParameter is NULL)
> > >
> > > In this case, you can run it in query analyzer like so:
> > >
> > > exec MyStoredProcedure 1 OR exec MyStoredProcedure ('blank')
> > >
> > > In this case, the first would return one record, and the second would return
> > > ALL records. So, if this is what you mean, then your problem is that when
> > > you try to pass a ' ' (blank value) to the report parameter you get an error.
> > > '
> > >
> > > -Aaron
> > >
> > >
> > > "Stefan Wrobel" wrote:
> > >
> > > > By the way, I'm speaking about when designing a report in Visual Studio
> > > >
> > > > "Stefan Wrobel" wrote:
> > > >
> > > > > I'm talking about the parameters in a SQL Server stored procedure. When I
> > > > > run the report, it's fine if I allow blank values, and there is no error.
> > > > > Only in Data View do I get the error when I try to run it or do refresh
> > > > > fields, and it asks me to input all parameters.
> > > > >
> > > > > "Aaron Williams" wrote:
> > > > >
> > > > > > Did you set the parameter to allow blank values?
> > > > > >
> > > > > > "Stefan Wrobel" wrote:
> > > > > >
> > > > > > > I have a stored procedure that gives different outputs based on whether an
> > > > > > > input parameter is given or not. When I set the parameter to blank, not
> > > > > > > NULL, I assume this will give the same result as running it in Query Analyzer
> > > > > > > and not inputting anything for that parameter, but instead I get a "input
> > > > > > > string was not in the correct format" error. Is this a bug? It is not the
> > > > > > > behavior I would expect. I think it is very important that blank parameters
> > > > > > > work correctly.|||Did you set the parameter to allow blank values?
"Stefan Wrobel" wrote:
> I have a stored procedure that gives different outputs based on whether an
> input parameter is given or not. When I set the parameter to blank, not
> NULL, I assume this will give the same result as running it in Query Analyzer
> and not inputting anything for that parameter, but instead I get a "input
> string was not in the correct format" error. Is this a bug? It is not the
> behavior I would expect. I think it is very important that blank parameters
> work correctly.|||By the way, I'm speaking about when designing a report in Visual Studio
"Stefan Wrobel" wrote:
> I'm talking about the parameters in a SQL Server stored procedure. When I
> run the report, it's fine if I allow blank values, and there is no error.
> Only in Data View do I get the error when I try to run it or do refresh
> fields, and it asks me to input all parameters.
> "Aaron Williams" wrote:
> > Did you set the parameter to allow blank values?
> >
> > "Stefan Wrobel" wrote:
> >
> > > I have a stored procedure that gives different outputs based on whether an
> > > input parameter is given or not. When I set the parameter to blank, not
> > > NULL, I assume this will give the same result as running it in Query Analyzer
> > > and not inputting anything for that parameter, but instead I get a "input
> > > string was not in the correct format" error. Is this a bug? It is not the
> > > behavior I would expect. I think it is very important that blank parameters
> > > work correctly.

Blank parameters

Hi,

In my report, a parameter has list of values in a drop down list (3 static values - Yes, No, Both). If user selects "Both" the results should contain all values with status Yes and No. My stored proc acheives this as -

ColumnName = @.Parameter + '%' in where clause.

I created Non-Queried list of values with Both as "" (empty string). When I run the report, the report is not getting any values. The matrix is empty where as the dataset and stored procedure are picking values for the same. ("" , empty string in the status parameter)

Is there any way the RS considers the empty values ? How do I achieve this ?

Regards,

Chiro

Ok,

Let me make it clear. The stored proc has a default parameter "Status" for which if you neither give "YES" nor give "NO" it gets results for all YES and NO status. This is acheived as

1. I defined stored procedure as - CREATE PROCEDURE ProcName @.Status = '%' varchar(10), @.Param2 varchar(10).......

2. In where clause - ColumnName = @.Status + '%'

Now if you just execute query without any parameters, it gets all values for status YES as well as NO. This is working fine.

I want to display all these results in a report. I created a list of values parameter with values YES, NO, BOTH for status. I allowed Null and Blank for the parameter.

I am binding the data to a matrix. When I run the report without giving any value to status, it is not displaying results in the matrix at all. Ideally it should display all values with status YES and NO.

Can any one tell me if there is any thing which I am missing here.

blank parameter

what's the diff between 'allow null value' and 'allow blank value'?
if I have a parameter with 'allow null value' and 'allow blank value'
selected, does that mean that I can run the report without having to
enter a value for that parameter?
I have a report that has 3 fields:
1) region
2) store
3) choice
A ) If a user selects a region from region paratmeter drop down then
selects 'by region' in the choice parameter and leaves the store
parameter blank...it's supposed to pull a report that lists all trans
grouped by region
B) If a user selects a store location from store paratmeter drop down
then selects 'by store' in the choice parameter and leaves the region
parameter blank...it's supposed to pull a report that lists all trans
grouped by the stor
I am able to do this when I run the query in the data tab. But when I
try to do the same using the report parameters...the report will only
run if I have something selected in both the region and store
parameters. I have selected both 'allow null value' and 'allow blank
value' for all the parameters.
But I also noticed that even though I have to select both region and
store parameters, the report will display the data by region if I
select 'by region' in the choice parameter or by store if I select 'by
store' in the choice parameter.
So, the data is displayed properly but I keep to have the select a
value for all fields.
I hope someone can help me out.Hi,
Allow Null and Blank depends on your query to handle. yes reporting server
should not allow, "Allow blank" to get checked when the data type is string
and the values are coming from drop down.
To work around this problem.
you can possibily give a union in your data tab something like this.
select ' ' as abc from table1
union
select distinct abc from table2
so the blank wont be visible instead a (null) is inserted for you to select.
This can be a possible solution.
Amarnath
"bevarg" wrote:
> what's the diff between 'allow null value' and 'allow blank value'?
> if I have a parameter with 'allow null value' and 'allow blank value'
> selected, does that mean that I can run the report without having to
> enter a value for that parameter?
> I have a report that has 3 fields:
> 1) region
> 2) store
> 3) choice
>
> A ) If a user selects a region from region paratmeter drop down then
> selects 'by region' in the choice parameter and leaves the store
> parameter blank...it's supposed to pull a report that lists all trans
> grouped by region
>
> B) If a user selects a store location from store paratmeter drop down
> then selects 'by store' in the choice parameter and leaves the region
> parameter blank...it's supposed to pull a report that lists all trans
> grouped by the stor
>
> I am able to do this when I run the query in the data tab. But when I
> try to do the same using the report parameters...the report will only
> run if I have something selected in both the region and store
> parameters. I have selected both 'allow null value' and 'allow blank
> value' for all the parameters.
>
> But I also noticed that even though I have to select both region and
> store parameters, the report will display the data by region if I
> select 'by region' in the choice parameter or by store if I select 'by
> store' in the choice parameter.
>
> So, the data is displayed properly but I keep to have the select a
> value for all fields.
>
> I hope someone can help me out.
>

Thursday, February 16, 2012

Blank page after specifying new parameter criteria.

I'm seeing an issue where, after changing the criteria in two date parameters
and clicking the "View Report" button, the screen is blanked out. If I click
the button again, the criteria is used, and the report is displayed.
Anyone else seeing this?
Is there any solution this?I've been having simular problems, although only on the preview pane, on the
report server it works fine
"Aaron" wrote:
> I'm seeing an issue where, after changing the criteria in two date parameters
> and clicking the "View Report" button, the screen is blanked out. If I click
> the button again, the criteria is used, and the report is displayed.
> Anyone else seeing this?
> Is there any solution this?|||I did notice that if I take out the default values I specified in my
parameters, it doesn't do this anymore. Weird...
Must be a bug.
"Antoon" wrote:
> I've been having simular problems, although only on the preview pane, on the
> report server it works fine
> "Aaron" wrote:
> > I'm seeing an issue where, after changing the criteria in two date parameters
> > and clicking the "View Report" button, the screen is blanked out. If I click
> > the button again, the criteria is used, and the report is displayed.
> >
> > Anyone else seeing this?
> >
> > Is there any solution this?

Blank Multi-value Parameters

Hi,

Lets say I have two multi-value parameters on a report. One is required, the other is not. The multi-value parameter that is not required is allowed to be blank. In the WHERE clause of my query I wanted to do this:

Code Snippet

AND
EXISTS
(SELECT * FROM SomeTable AS ST_1
WHERE (MyCode IN (@.My_Codes2)) OR @.My_Codes2 IS NULL)

Of course I can't do that since multi-value parameters are not allowed to be null. I see that they are allowed to be blank, but how do I check for that? I tried

Code Snippet

OR @.My_Codes2=''

That doesn't work. I can set a default value of 'None' and say:

Code Snippet

OR @.My_Codes2='None'

Unfortunately this doesn't work. As long as the default value is 'None' it's fine. When I fill in the parameter I get the following error:

  • An expression of non-boolean type specified in a context where a condition is expected, near ','.

    Please note that I am not using a TSQL stored procedure here. It's just a plain old embedded SQL statement.

    Thanks,

    DD

    Darren:

    This is kind of klunky, but if @.My_Codes2 is a character datatype you might be able to use the COALESCE function to dodge around this. Instead of a where clause like this:

    Code Snippet

    WHERE (MyCode IN (@.My_Codes2)) OR @.My_Codes2 = '')

    You might be able to get by with something like this:

    Code Snippet

    WHERE (MyCode IN (@.My_Codes2)) OR COALESCE(@.My_Codes2, '') = '')

    As an example, I created a report based in an derived table of integers 1-5 with a multi-value parm @.my_codes2:

    Code Snippet

    select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '') = ''

    I turned on PROFILER so that I could catch the interpreted code that was sent to SQL Server from Report Services so that I could examine what Report Services is doing under the hood. When I leave pass a blank for @.My_Codes2 the code gets interpreted into the following and returns all of the data in the table:

    Code Snippet

    exec sp_executesql N'select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '''') = ''''',
    N'@.My_Codes2 nvarchar(1)',@.My_Codes2=N' '

    /*
    myCode
    --
    1
    2
    3
    4
    5
    */

    When I pass a parameter of '1' for my parameter it gets interpreted similarly and returns only the matching row:


    Code Snippet

    exec sp_executesql N'select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '''') = ''''',
    N'@.My_Codes2 nvarchar(1)',@.My_Codes2=N'1'

    /*
    myCode
    --
    1
    */

    When I actually pass in '1' and '3' as multiple parameters, the statement gets interpreted a little differently and returns the correct two matching rows:


    Code Snippet

    select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (N'1',N'3') or coalesce(N'1',N'3', '') = ''

    /*
    myCode
    --
    1
    3
    */

    I am not using the coalesce with intentions of catching NULLS but rather am using it is a receiver that will handle the different interpretations of the parameters. The main problem with this is that this will return the entire target list if you pass multiple parameters and the first parameter is a blank.

    |||

    Hi Kent,

    A multi-value parameter can't be null so COALESCE doesn't work unfortunately.

    The way I got around it was by using another parameter:

    Code Snippet

    WHERE MyCode IN (@.My_Codes2))

    OR

    @.Use_Other_Codes = 1

    Klunky but it works.

    Thanks,

    Darren

    |||Darren -

    I think I am trying to do the same thing as you <http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1885823&SiteID=1>. Do you think you could take a look and help me out? I'm not sure I'm fully understanding how you got around your problem.

    Thanks,
    Josh

  • Blank Multi-value Parameters

    Hi,

    Lets say I have two multi-value parameters on a report. One is required, the other is not. The multi-value parameter that is not required is allowed to be blank. In the WHERE clause of my query I wanted to do this:

    Code Snippet

    AND
    EXISTS
    (SELECT * FROM SomeTable AS ST_1
    WHERE (MyCode IN (@.My_Codes2)) OR @.My_Codes2 IS NULL)

    Of course I can't do that since multi-value parameters are not allowed to be null. I see that they are allowed to be blank, but how do I check for that? I tried

    Code Snippet

    OR @.My_Codes2=''

    That doesn't work. I can set a default value of 'None' and say:

    Code Snippet

    OR @.My_Codes2='None'

    Unfortunately this doesn't work. As long as the default value is 'None' it's fine. When I fill in the parameter I get the following error:

  • An expression of non-boolean type specified in a context where a condition is expected, near ','.

    Please note that I am not using a TSQL stored procedure here. It's just a plain old embedded SQL statement.

    Thanks,

    DD

    Darren:

    This is kind of klunky, but if @.My_Codes2 is a character datatype you might be able to use the COALESCE function to dodge around this. Instead of a where clause like this:

    Code Snippet

    WHERE (MyCode IN (@.My_Codes2)) OR @.My_Codes2 = '')

    You might be able to get by with something like this:

    Code Snippet

    WHERE (MyCode IN (@.My_Codes2)) OR COALESCE(@.My_Codes2, '') = '')

    As an example, I created a report based in an derived table of integers 1-5 with a multi-value parm @.my_codes2:

    Code Snippet

    select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '') = ''

    I turned on PROFILER so that I could catch the interpreted code that was sent to SQL Server from Report Services so that I could examine what Report Services is doing under the hood. When I leave pass a blank for @.My_Codes2 the code gets interpreted into the following and returns all of the data in the table:

    Code Snippet

    exec sp_executesql N'select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '''') = ''''',
    N'@.My_Codes2 nvarchar(1)',@.My_Codes2=N' '

    /*
    myCode
    --
    1
    2
    3
    4
    5
    */

    When I pass a parameter of '1' for my parameter it gets interpreted similarly and returns only the matching row:


    Code Snippet

    exec sp_executesql N'select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (@.My_Codes2) or coalesce(@.My_Codes2, '''') = ''''',
    N'@.My_Codes2 nvarchar(1)',@.My_Codes2=N'1'

    /*
    myCode
    --
    1
    */

    When I actually pass in '1' and '3' as multiple parameters, the statement gets interpreted a little differently and returns the correct two matching rows:


    Code Snippet

    select myCode
    from ( select 1 as myCode union all select 2 union all
    select 3 union all select 4 union all select 5
    ) as numbers
    where myCode in (N'1',N'3') or coalesce(N'1',N'3', '') = ''

    /*
    myCode
    --
    1
    3
    */

    I am not using the coalesce with intentions of catching NULLS but rather am using it is a receiver that will handle the different interpretations of the parameters. The main problem with this is that this will return the entire target list if you pass multiple parameters and the first parameter is a blank.

    |||

    Hi Kent,

    A multi-value parameter can't be null so COALESCE doesn't work unfortunately.

    The way I got around it was by using another parameter:

    Code Snippet

    WHERE MyCode IN (@.My_Codes2))

    OR

    @.Use_Other_Codes = 1

    Klunky but it works.

    Thanks,

    Darren

    |||Darren -

    I think I am trying to do the same thing as you <http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1885823&SiteID=1>. Do you think you could take a look and help me out? I'm not sure I'm fully understanding how you got around your problem.

    Thanks,
    Josh

  • Friday, February 10, 2012

    Bitmask Multi-value report parameters

    Hello all,
    Is there any way to return a multi-value parameter as a sum of the
    values instead of a comma seperated string?
    For example, I have a table where one of the values is a bitmasked
    number, representing a combination of 4 possible options.
    I have the Report Parameter setup with Non-queried values. Ex. Opt1 = 1, Opt2 = 2, Opt3 = 4, Opt4 = 8.
    And in my query, the WHERE clause is setup like: WHERE @.param &
    ColumnX != 0
    But of course, if I select multiple values for Opt1 and Opt3, it
    returns 1,4 instead of 5.
    Any suggestions?
    Thanks - JasonYour parameter can be mapped to an expression. Query parameter and Report
    Parameters are two different things. RS automatically creates the report
    parameter for you so it seems like they are the same thing.
    To do this is a two step process:
    1. In layout tab, Report Menu ->Report Parameters. Change the name of the
    parameter so it does not equal the name in your query.
    2. Dataset tab, click on the ..., parameters tab. In the right column click
    on the mapping and change to an expression which brings up the expression
    builder. Have the expression builder change this to the way you want. You
    might need to create some code behind report to do this.
    I suggest whipping together a little VB test app to work out the code to
    convert a comma separated string into a bitmask.
    Bruce Loehle-Conger
    MVP SQL Server Reporting Services
    "Jason" <flajason@.gmail.com> wrote in message
    news:1176830583.305883.64460@.n59g2000hsh.googlegroups.com...
    > Hello all,
    > Is there any way to return a multi-value parameter as a sum of the
    > values instead of a comma seperated string?
    > For example, I have a table where one of the values is a bitmasked
    > number, representing a combination of 4 possible options.
    > I have the Report Parameter setup with Non-queried values. Ex. Opt1 => 1, Opt2 = 2, Opt3 = 4, Opt4 = 8.
    > And in my query, the WHERE clause is setup like: WHERE @.param &
    > ColumnX != 0
    > But of course, if I select multiple values for Opt1 and Opt3, it
    > returns 1,4 instead of 5.
    > Any suggestions?
    > Thanks - Jason
    >