我有一个网页,其中有报告名称的定位标记。单击报表名称(锚标记)后,我进行了ajax调用,该调用将报表URL传递给后端方法。通过这种方法,我提供了访问报告并将报告显示为局部视图的凭据。下面是代码:
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");
}
我遇到The report parameter 'ReportParameter1' is read-only and cannot be modified. (rsReadOnlyReportParameter)
错误。这是一个具有默认值的内部参数,我不想将其更改为“可见”或“隐藏”。
是否可以使用C#代码解决此问题?