Parameter is missing a value ssrs 2008
Asked Answered
A

10

20

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!

Andantino answered 23/6, 2012 at 10:22 Comment(1)
Hmm? If you have a parameter that's both hidden and required you'd have to provide a value through some other means. If you are doing so, please extend your answer and tell us how you're doing that. Without that info we can't help you any further...Isodiametric
R
18

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

Roccoroch answered 20/7, 2012 at 18:1 Comment(2)
The answer I was searching from last 2 days.Contralto
My report has been running like that for a couple weeks, but 'something' changed and removing available values did the trick. Thanks!Gooseberry
W
6

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
Westbrooke answered 10/5, 2013 at 16:18 Comment(0)
L
6

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.

Loathsome answered 29/1, 2016 at 9:46 Comment(1)
What if the default value have to be retrieve from database (using dataset)? set Available Values to None doesn't work.Calzada
S
3

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

Sheehy answered 4/3, 2015 at 8:51 Comment(0)
A
2

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".

Amy answered 4/8, 2016 at 11:43 Comment(0)
Y
1

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

Yolande answered 22/4, 2013 at 15:23 Comment(0)
S
1

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

Saltandpepper answered 2/7, 2014 at 11:54 Comment(0)
S
0

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...

Sheet answered 19/7, 2013 at 17:9 Comment(0)
P
0

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.

Proximity answered 30/8, 2018 at 1:57 Comment(0)
C
0

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.

Cassiodorus answered 15/9, 2020 at 4:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.