February 12, 2014 at 12:55 pm
By following http://geekswithblogs.net/GruffCode/archive/2012/06/21/using-table-valued-parameters-with-sql-server-reporting-services.aspx I have successfully created a report that ask for multiple zip codes, as there is a long list so we are using table valued parameters as a parameter for report. This is working fine from report service URL and in Business intelligenece studio.
Now I need to call this report from my ASP.net c# applicatiopn. I tried following and then stuck as it ask for string parameter only.
RView.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
RView.ServerReport.ReportServerUrl = new Uri("http://bart:85/Reports"); // Report Server URL
RView.ServerReport.ReportPath = "/RHDCReports/NewCustomerActivityByZipCodes"; // Report Name
RView.ShowParameterPrompts = true;
RView.ShowPrintButton = true;
DataTable dataTable = new DataTable("ZipCodesTable");
dataTable.Columns.Add("ZipCode", typeof(string));
dataTable.Rows.Add("03054");
dataTable.Rows.Add("10583");
Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[1];
Param[0] = new Microsoft.Reporting.WebForms.ReportParameter("ZipCodes", dataTable);
// Below code demonstrate the Parameter passing method. User only if you have parameters into the reports.
Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];
reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
reportParameterCollection[0].Name = "ZipCodes";
reportParameterCollection[0].Values.Add(??.ToString()); // here is the problem
RView.ServerReport.SetParameters(Param);
RView.ServerReport.Refresh();
please help !!
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply