views:

154

answers:

1

I am trying to develop a report in SQL Server Reporting Services using parameters.

I have no problem creating the parameters and running the reports, but I always have to select an item from each of the parameters to make it run. Can I have the option to leave one of the parameters blank and still have the report run? Right now when I hit 'view report', I always get the error that I must make a selection to continue.

+3  A: 

Check off the Allow blank value checkbox for the parameter(s) you want to allow a blank value for.

  1. Right click anywhere outside the report on the Layout tab
  2. Select Report Parameters
  3. Select the parameter you want to allow blank values for
  4. Check off the Allow blank value checkbox

Repeat as needed for each parameter.

OMG Ponies
I have tried this with no luck. I have also tried 'allow null value' and every combination of both.
Hunter
How are you testing? If from the server, are you sure you're deploying before testing?
OMG Ponies
I have not deployed the report. I am using the preview tab to test the report.
Hunter
I'm testing in SSRS 2005 - the behaviour works as expected for me in the Preview tab. If a parameter has "allow blank" checked off, I don't get prompted if I left it blank and vice versa.
OMG Ponies
Ok, so why do you think I am getting prompted? I am obviously missing something? Could it have something to do with my SQL Query?
Hunter
IME, it has nothing to do with the query - the values don't get to it if the View Report validation doesn't let you through.
OMG Ponies
OMG Ponies
That could be my problem. I am trying to get a blank value from a drop down list. I have tried it with a text box and it works, but that does not solve my problem. What is the solution for a drop down list?
Hunter
You can set a default value in the Report Parameters, Default values section (bottom righthand corner). Select the **Non-queried** radio button, and provide the value (**not** the label value). I've found "=[value]" is what works when the report is deployed, but the Preview tab has preferred to not have the "=" portion sometimes for me.
OMG Ponies
This does not help. It will only accept a default value that is already in the Drop Down List. If it doesn't exist in the list, it will ask me to make a selection and that defeats what I am trying to accomplish. I am thinking I might have to assign a blank record to the start of my Data Set through the query and then set that to my Default value.
Hunter
Yes, the default value has to exist in the drop down list of values.
OMG Ponies
Thanks for your help!
Hunter