Passing null param value to SSRS executionService 2005 in asp.net

Posted by SurajRane under ASP.NET on 9/29/2010 | Points: 10 | Views : 3716 | Status : [Member] | Replies : 1
Hi

is anyone knows how to pass SSRS report parameter as NULL to SSRSExecutionService2005 via code.

I am using SSRS web services to generate report and rendering its MHTML to aspx page.

PROBLEM: I am using below code

SSRSReportExecutionService2005.ParameterValue[] rptParameters = new SSRSReportExecutionService2005.ParameterValue[2];

rptParameters[0] = new SSRSReportExecutionService2005.ParameterValue();
rptParameters[0].Name = "Campaign";
rptParameters[0].Value = campaignId.ToString();

rptParameters[1] = new SSRSReportExecutionService2005.ParameterValue();
rptParameters[1].Name = "Survey";
rptParameters[1].Value = null;

rsExec.SetExecutionParameters(rptParameters, "en-us");
results = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); // getting error Here Response.ContentType = "message/rfc822";
Response.AddHeader("content-length", results.Length.ToString());
Response.BinaryWrite(results);

Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();


I am getting below exception:
This report requires a default or user-defined value for the report parameter 'Survey'

please help as soon as possible




Responses

Posted by: Sksamantaray on: 1/9/2012 [Member] Silver | Points: 25

Up
0
Down

In the rdl file in Report Parameter section Chage the property allownull to true and check

Thanks,
Sanjay

SurajRane, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response