I have a web page where there are anchor tags for report names. On click of report name (anchor tag), I have ajax call which passes report URL to the backend method. In that method, I am providing credentials for accessing the report and showing report as a partial view. Below is the code:
public ActionResult Report(string rptPath)
{
ReportViewer rptViewer = new ReportViewer();
rptViewer.ProcessingMode = ProcessingMode.Remote;
rptViewer.SizeToReportContent = true;
rptViewer.ZoomMode = ZoomMode.PageWidth;
rptViewer.Width = Unit.Percentage(100);
rptViewer.Height = Unit.Percentage(1000);
rptViewer.AsyncRendering = true;
rptViewer.ServerReport.ReportServerUrl = new Uri(xxxx);
rptViewer.ServerReport.ReportPath = rptPath;
IReportServerCredentials irsc = new CustomReportCredentials(uname, pword, domain);
rptViewer.ServerReport.ReportServerCredentials = irsc;
ViewBag.ReportViewer = rptViewer;
return PartialView("Report");
}
I am getting The report parameter 'ReportParameter1' is read-only and cannot be modified. (rsReadOnlyReportParameter)
error. This is an internal parameter having a default value and I don't want to change it to Visible or Hidden.
Is there any option to solve this issue using the c# code?