【发布时间】:2011-01-28 09:28:16
【问题描述】:
我有一个使用 SQL Server 报告查看器的应用程序,它显示一些服务器报告。在 Visual Studio 下调试应用程序时,我能够运行 Aspx 应用程序并查看报告。但是当我发布 web 应用程序并尝试查看报表时,报表控件不会呈现报表数据。我只能看到报表控件的过滤器部分和 ViewReport 按钮。单击按钮后,会发生回发,并且应用的每个过滤器都会重置。
我也可以通过报表服务器的报表管理器查看报表。我想知道当我将应用程序托管到服务器时,是什么阻止了报表查看器。
我正在使用 IIS 6.0、SQLServer 2005、Visual Studio 2005 (ASP 2.0) 和 Report Viewer 8.0
以下是我在页面中使用的代码
protected void Page_Load(object sender, EventArgs e)
{
string svrRep = ConfigurationManager.AppSettings["ReportServerURI"].ToString();
this.rptViewer.ServerReport.ReportServerUrl = new Uri(svrRep);
if (!Page.IsPostBack)
{
this.rptViewer.ServerReport.ReportPath = "/MyReportFolder/My_Report";
}
}
这是报表查看器的标记
<div style="width: 1095px; height:600px">
<rsweb:ReportViewer ID="rptViewer" runat="server" Font-Names="Arial" Font-Size="8pt" SizeToReportContent="true"
Height="100%" ProcessingMode="Remote" Width="100%" BackColor="Silver" BorderColor="#666666" >
<ServerReport ReportServerUrl="" />
</rsweb:ReportViewer>
</div>
请大家帮我解决这个问题。
【问题讨论】:
标签: sql reporting-services reportviewer