Adarsh
Adarsh

Reputation: 203

Parameter is missing a value ssrs 2008

I have a parameter of integer datatype which is hidden. When i run the report, report gives me an error

Parameter X is missing a value

However if i make the parameter visible it works. I tried providing default value of 0 but that does not suffice my requirement as i have sub-report(Drill-dowm) depended on this parameter. Please help. Thanks!

Upvotes: 20

Views: 54428

Answers (10)

dazlari
dazlari

Reputation: 1

There is one other potential here. I have had a situation where the report designer works but the server report object does not. The solution is to delete the server object and then re-save it from the designer.

Upvotes: 0

Glen
Glen

Reputation: 830

I had a similar issue where the default value as set by SSRS is (Null), I didn't need the parameter for my report however; I found it useful for testing to filter down the list so I kept it, I guess I could have deleted it in SSRS on the dataset config. but I changed it to =System.DBNull.Value (I guess this could be any expression) instead and that worked for me, so then I can still pass in a value if need be and also set Available values (had to make sure a NULL value was added to my dataset) if I then decide to unhide at a later date.

Upvotes: 0

Adrian
Adrian

Reputation: 665

The problem occurs also, if you have a parameter that depends of another one without "default value" inside the Dataset Query and does not admit null value.

For example:

Parameter 1 have a default value: NameEmployee from the dataset "EmployeeSearch"

But the dataset "EmployeeSearch" have a filter or a parameter inside the query named @Month that indicate the number of the month. So if the value of @Month is null, SSRS will say "Parameter is missing a value".

Upvotes: 2

Pedram
Pedram

Reputation: 6508

First of all,

Check that parameter's - Available Values by going to report parameters properties.

It must not be specified any values. So we should set it as None

Second work around is,

Just add a blank space at Specify values - in Default values inside report parameters properties.

This will surely work. Hope it will save your time.

Upvotes: 6

Vitaliy
Vitaliy

Reputation: 31

If you specify available values from query, then default values must be in list of available values. Default value in (Available) = true.

Upvotes: 3

MobileMon
MobileMon

Reputation: 8661

Just need to add 1 default value to get around this error (even though that default value will never be used).

-Under "Report Parameter Properties" for that specific parameter, go to the Default Values page.

-Toggle "Specify values"

-Add a value (I added: "just_a_filler_to_get_around_hidden_value_error" so when I look back at it later I remember why I did such a thing)

-click OK

Upvotes: 1

Clinton Edwards
Clinton Edwards

Reputation: 11

I want to add to dmbreth's CORRECT answer.

I was missing the concept that the value of the parameter still needed to be tied to something. Originally, I was tying the output of a dataset by using the Available values portion of the parameter properties, but according to dmbreth's answer, that could not be the case. Finally I moved my output dependence settings from the Available Values section to the Default Values section and that did the trick.

So, in summary, in the parameter properties dialogue:

General Page - Allow multiple values checked(this option is specific to my application), parameter visibility set to internal

Available Values Page - None

Default Values Page - Get values from query, [appropriate dataset, value here]

Advanced Page - No significance here

Hopefully, that is clear enough to benefit someone else with the same problem...

Upvotes: 0

Rainhider
Rainhider

Reputation: 836

I had to do an "if exists" statement for this to go away. It worked for me because it makes it always return a value even if that value is not need by my query.

    if exists (my select query)
    my select query
    else 
    select '2' 
    // '2' would never be used, but it made ssrs stop giving me
    // the stupid error and execute the rest of the query

Upvotes: 6

Johann
Johann

Reputation: 12408

Assuming you had the same issue as I had, trying to run the report on a web page using a ReportViewer component, I managed to fix that issue by adding a null parameter before rendering the report:

C# code:

var parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter("ParameterName", (string)null));
ReportViewer1.ServerReport.SetParameters(parameters);

Hope that will help

Upvotes: 1

dmbreth
dmbreth

Reputation: 191

Make sure that you have not specified Available Values for the parameter. Available Values should be "None" for internal and hidden parameters.

Upvotes: 19

Related Questions