Parameter x is missing a value bids 2008 - reporting-services

I created a new report for an overview of a company. I added a report parameter, which default value is determined by query. But if I run the report and this query returns no results, I get the error "Parameter x is missing a value."
I found this post Parameter is missing a value ssrs 2008. But setting the available values to none didn't solved my problem. I allowed empty and null values too.
If I make the parameter visible everything is okay, I can choose a value or not and it works.
My parameter has following settings:
Type: text
Allow empty values: true
Allow null values: true
Allow multiple values: false
Parameter visibility: Hidden
Available values: none
Default values: Get values from a query (this query sometimes has no results)

This appears to be a glitch with SSRS.
From this MSDN blog post:
Force the update of the properties by renaming the parameter
Open the report for editing in Visual Studio.
Expand the Parameters node and rename the affected parameter to ParameterName1.
Set Allow Blank and Nullable to True if not already set.
Deploy the report.
Rename the parameter back to ParameterName.
Deploy the report.

Related

SSRS parameter defaults to NULL (All) even though no default value is set

I have a SSRS report parameter that is incorrectly defaulting to NULL (All), when I have the 'No default value' option selected. The parameter uses a stored procedure to load available values, and there are several values in my parameter drop-down-box.
When I view my report in preview mode or on the SSRS poral, my parameter is automatically set to All (NULL). What would make this happen?
The XML code shows no default values either:
<ReportParameters>
<ReportParameter Name="[My Parameter Name]">
<DataType>Integer</DataType>
<Nullable>true</Nullable>
<Prompt>My Parameter</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>MyDataSet</DataSetName>
<ValueField>MyParameterID</ValueField>
<LabelField>MyParameterName</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
As some users stated in the comments, you must delete and redeploy the report to update parameter defaults. According to Microsoft this is a known issue:
Parameter defaults do not get updated when re-deploying existing
reports. These either have to be updated manually or the reports
deleted and re-deployed. The latter regenerates all report ID's
(GUID's) and makes traking usage from the ExecutionLog more difficult.

SSRS deselecting from Multi Value Parameter issue

I am having issues with Multi Value Parameter in SSRS Report.
My Parameter contains 10 values. If I Deselect All the values from Parameter I get error that the Parameter cannot be blank so I go back to the drop down and it does not get filled in with the values. I deleted two items from the Parameter and I do not get issues and my list gets populated if I deselect everything.
If i am not wrong, You are saying your parameter drop down gets cleared out once you get the error that "Parameters cannot be blank" ? How about checking "Allow blank" in parameter properties http://msdn.microsoft.com/en-us/library/aa337234(v=SQL.100).aspx ?
Another thing you may like to check is, if there is any non-ascii character in your parameter drop down's available value. Manipulating this parameter values at run time (check/uncheck) could eventually lead to unexpected behaviors like parameters clearing out or report never rendering.

Getting a "one or more parameters required to run the report have not been specified" error

I am building a report that I would like to accept two values from the user, feed those into a query, and find the data associated with those entries.
For example, if you had a list of employees, performance measures, and values associated with those; then the user would select an employee name / performance measure, and they would get the scoring information on that employee for that measure.
I have two parameters, each being populated from SQL queries getting a distinct list of employee names and measures, and a table below that just pulls up information based on ~ 'WHERE name = #Name AND measure = #Measure' but when I click 'Preview' to run the report locally I get the error: "one or more parameters required to run the report have not been specified"
I know the parameters are working properly because I can feed their values directly into a textbox and the values populate correctly. Also, if I change the query to just accept one parameter (i.e. WHERE measure = #Measure) the query works.
I'm confused as to why this error is occurring since I know my parameters are functioning and being populated properly.
I experienced this behavior in .NET 4.0 using Local Reports (in .rdlc files), when one of the parameter's values was containing an emtpy string. Although setting the parameter was correct:
report.SetParameters(
new List<ReportParameter> {
new ReportParameter("Title", Messages.Title),
new ReportParameter("SubTitle", Messages.Subtitle))
}
);
It worked only as long as both parameters actually contained some characters, otherwise the mentioned exception was thrown.
This error is caused when you either
A) the parameter is spelled wrong in the actual report. Meaning that the query is expecting #Name but the report is passing #Names (or some other spelling).
or
B) Is it possible you are attempting to run the report with a default value on the parameter of NULL for #Name but the stored procedure requires an actual value?
This might be happening if you are building the report in Visual Studio and gave the #Name parameter a default value of (null).
Try removing the default value or making sure you #Name parameter has an actual value, even if it's just ''.
I had similar issue. Issue happened when you use SharedDataSource with parameters that are to have null value. If you use same query in embeded data source, there is no problem.
Unlike embebed data source, you have to define if parameters used in query of shared data sources are allowed to have null value as highlighted in screenshot here. In my case, there are two parameters in query of shared data source, that can have null value.
So after setting them to allow null, problem fixed!
This caused me many hours of pain. Turns out that it's to do with using a shared dataset.
Embed the dataset within your report instead and it works fine.
For me, setting the value of the parameter makes problem. I don't know why, but the parameter value was not able to accept a string.Empty or null. So i just gave a " " as value solves the error.
Sample
ReportParameter[] parameters = new ReportParameter[4];
parameters[0] = new ReportParameter("Name", EName);
parameters[1] = new ReportParameter("ShiftName", CurrentShift);
parameters[2] = new ReportParameter("Date", LoginDate);
if(ValidateReportData())//some condition
{
parameters[3] = new ReportParameter("Date1", LoginDate);
}
else
{
//parameters[3] = new ReportParameter("Date1", string.Empty);//this makes exception while calling Render function.
parameters[3] = new ReportParameter("Date1", " ");//Solves the issue.
}
I was having the same problem, it is now sorted on sql server 2008 r2.
I know this is now an old question,
but just to help others:
It was very simple really, just making sure the spelling including the case is the same and the use of #.
I have a shared dataset called currentSpaceByDrive with the following code:
SELECT
[DRIVE]
,[Volume_Size_GB]
,[VolumeSpaceAvailable_GB]
,[VolumePercentAvailable]
FROM monitoring.dbo.currentSpaceByDrive(#ServerID)
I add the shared dataset currentSpaceByDrive to my report and I give it the same name.
when I right click on it, the one on my report, dataset properties, the parameter is #ServerID.
#ServerID value comes from another dataset, called the_servers (where the user selects a serverID)
I have a report parameter also called #ServerID that gets its value from the_servers and is used to feed the #ServerID parameter on currentSpaceByDrive.
Too many #ServerID, I understand, but if you do your own test based on this, you will get it done.
See the image attached.
hope this helps
marcelo
check DataSet In Report Server , I had Similar Problem , I was Editing Shared Dataset in Visual Studio , but it didn't work , after an hour of frustration I checked dataset in report server and I found out it Is not updating with changes I made in visual studio , I Delete it and Redeploy Dataset Again from visual studio . it works .
Actually I had to:
Delete the SubReport object from the report.
Drag new object from Toolbox
Setup the SubReport name and report
In Paramateres "Add", and choose each parameter, and related value.
Then is works for me.
I think I have same issue my Parameter Supervisor is blank when I choose "Select All" which causes the error "One or more parameters were not specified for the subreport", but if I select a few supervisor name then the sub-report appears. It is puzzling because the Manager parameter value shows all value when "Select All" is checked, but it is not working on my Supervisor parameter. Note that Supervisor parameter is dependent on manager parameter.
I'm using shared DataSets for several reports, and the root cause of this issue was not mapping the input parameters from the report itself to the parameters of the shared dataset.
To fix, I navigated to the "Report Data" panel, opened the dataset (which is really linking to a shared dataset), clicked the "Parameter" tab, and then mapped the report parameters to the parameters of the shared dataset.

How to prevent parameter error for NULL dataset?

I developed an RDL file with a parameter set to be the field value, named "Client", of one of my datasets. I use this parameter value in the page footer because this was the only way I could get Client to appear correctly in the footer. The other methods Client value did not always appear correctly.
Here is what this parameter properties look like:
So this works if there is data, however, if there are no records in rpt_rd_RecreationTherapy, then I get the following error:
and in my page footer, I have a text box set to the following:
=iif(isnothing(Parameters!new_youth.Value),"",Parameters!new_youth.Value)
Yes, I checked "allow blank value" to my parameter configuration
Jeroen is probably correct. I would access the Reports, Parameter setting using Report Manager and update it to match the BIDS setting.

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!
Make sure that you have not specified Available Values for the parameter. Available Values should be "None" for internal and hidden parameters.
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.
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
If you specify available values from query, then default values must be in list of available values. Default value in (Available) = true.
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".
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
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
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...
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.
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.