我在这里遇到报告查看器的一些问题。
它不显示报表查看器,我真的很
不知道是什么问题。
这是我的代码
private ServerReport LoadReportViewer()
{
ReportViewer.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = ReportViewer.ServerReport;
serverReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerURL"]);
serverReport.ReportPath = ConfigurationManager.AppSettings["ReportServerPath"];
var paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("ID", ID.ToString(), false));
paramList.Add(new ReportParameter("UserID", UserID.ToString(), false));
ReportViewer.ServerReport.SetParameters(paramList);
ReportViewer.ServerReport.Refresh();
return serverReport;
}
ASPX
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<rsweb:ReportViewer ID="ReportViewer" runat="server" Width="100%" Height="90%" ShowExportControls="False"></rsweb:ReportViewer>