Showing posts with label driven. Show all posts
Showing posts with label driven. Show all posts

Thursday, February 16, 2012

Allow null value option in Report Parameters

Hi,
I have very simple parameter driven report that accepts a null value.
When I enable "Allow null value" option under VisualStudio's Report Parameter, the null checkbox is checked by default when I run the report.
Is there anyway that I can uncheck the null check box by default via Visual Studio?
I know I can disable this from Report Property -> Parameter -> Has Default in Report Manager, but I would really like to do this from Visual Studio.
Thank you!You would need to provide a non-null default value for the parameter.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"thepacket" <thepacket@.discussions.microsoft.com> wrote in message
news:06A83613-51EF-4A1A-B23F-61AF592AFC81@.microsoft.com...
> Hi,
> I have very simple parameter driven report that accepts a null value.
> When I enable "Allow null value" option under VisualStudio's Report
Parameter, the null checkbox is checked by default when I run the report.
> Is there anyway that I can uncheck the null check box by default via
Visual Studio?
> I know I can disable this from Report Property -> Parameter -> Has Default
in Report Manager, but I would really like to do this from Visual Studio.
> Thank you!
>

Monday, February 13, 2012

Allow Blank in parm not working

I am using RS2005. I have a data driven parm that I have checked "allow blank" as a value. I cant allow null so that isnt checked. I have even entered a space in the area where you can provide a default value. When I preview the report ... this parameter has <Select a Value> in the combo box. All other parms are filled in with defaults so the report should run. I hit "View Report" and get an error message "Please select a value for the parameter 'ParameterX' " which is the parameter I have said could be blank. Of course if I drop down the list there isnt a blank value to select - and I dont see why I would want to add one and force a selection of spaces ... seems like something is wrong here. Please help if you can. I am hoping it is just something simple.

Hello,

So let me get this right you have a drop down in the report that you want to be able to display a blank value you and contain a black value at the same time ?

what you can do is add a few lines of code to the sproc or sql statement that produces the resaults for the drop down parameter .

~~~~~~~~~~~ sample code

select EmployeeName, 2 as sort_col

from empdb

union all

select ' ' as EmployeeName, 1 as sort_col

Order by sort_col

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This will work in TSQL and there is a work around for oracle and teradata

|||

Thanks Charles,

I am using RS2005. The parm is a drop down list box. My question is why does my user have to select *anything* for that parameter if they want to leave it blank? Why do I have to insert a join to my query to add in a blank value which appears as a line of spaces in the drop down list. If the list is left untouched, and I have provided a default value of spaces (when I set up the parameter I gave it a default of spaces) - then why would it not work? It shows <Select a Value> text in the window of the list and forces you to make a selection ... if you want to leave it blank ... that is not an option. What is the purpose of having a check box "allow blanks" when you set up the parameter if there isnt any way to exercise the option of leaving it blank? I dont want to make my user *select* a blank line ... they should just be able to bypass that parameter if they dont want to make a selection.

|||

The allow blank works for input parameters. in order for blanks to be aloud in a drop down the sproc behind it must supplied the blank value

|||it seems very strange to me that I have to make them *choose* a blank ... since the idea is to minimize keystrokes by supplying a default value. Thanks for the reply :-)