asp.net – 报表查看器控件(Web)显示空白报告
发布时间:2020-12-16 00:31:54 所属栏目:asp.Net 来源:网络整理
导读:我有一个包含ReportViewer控件的Web表单,一个DIV元素,所以我可以看到该页面实际呈现。我看到我的页面正确加载,我看到在Fiddler中访问的报表服务,但是从来没有任何显示。 目前,我正在使用一个静态文本的报告,没有查询,以确保我隔离问题。 我的页面如下
我有一个包含ReportViewer控件的Web表单,一个DIV元素,所以我可以看到该页面实际呈现。我看到我的页面正确加载,我看到在Fiddler中访问的报表服务,但是从来没有任何显示。
目前,我正在使用一个静态文本的报告,没有查询,以确保我隔离问题。 我的页面如下: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="PeopleNet.Web.Views.Reports.ReportViewer" %> <%@ Register Assembly="Microsoft.ReportViewer.WebForms,Version=11.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="~/scripts/jquery-1.7.2.js" /> <asp:ScriptReference Path="~/scripts/fixReportViewer.js" /> </Scripts> </asp:ScriptManager> <div> This is the report viewer page... </div> <rsweb:ReportViewer ID="ReportViewer1" runat="server"></rsweb:ReportViewer> </form> </body> </html> 显示报告的代码是: protected void Page_Load(object sender,EventArgs e) { this.ReportViewer1.ServerReport.ReportServerUrl = ConfigurationFacade.ReportServerUri; this.ReportViewer1.ServerReport.ReportPath = { path to report name }; this.ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials(); // custom class implementing IReportServerCredentials as described in various places around the web,including SO this.ReportViewer1.ServerReport.Refresh(); } 我的web.config文件根据需要配置HttpHandler: <system.web> <!-- abbreviated... --> <httpHandlers> <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms,PublicKeyToken=89845dcd8080cc91" validate="false" /> </httpHandlers> </system.web> 和: <system.webServer> <!-- abbreviated... --> <handlers> <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler,PublicKeyToken=89845dcd8080cc91" /> </handlers> </system.webServer> 服务器运行Windows 2008和SQL Server 2008 R2。 我正在使用SQL Server 2012版本的查看器,因为我们正在将我们的环境更新到2012。 我已经反复验证报告可以从ReportManager访问,没有任何问题。 我试图在IE9中访问这个,看到与其他浏览器一起说明的各种问题。 我目前(仅用于测试)传递我的凭据作为报表服务器凭据。我是Reporting Services管理员,也是服务器上的服务器管理员组成员。 我已经检查了事件日志和ReportServerService日志,并没有发现任何错误。 更新:看起来像将AsyncRendering更改为false,并确保我不尝试使用空集合“SetParameters”,这主要被清除: this.ReportViewer1.AsyncRendering = false; 我在配置/代码中缺少什么? 解决方法
我解决这个问题的方法是将报表查看器的高度设置为100%。没有报告显示。将高度更改为px值(即900像素)可使报表查看器工作。
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 使用内部SecurityException抛出异常仅在ASP.NET MVC中显示内
- 按代码更改ASP.NET成员资格提供程序
- asp.net-mvc-3 – 从DataTable填充MVC Webgrid
- asp.net – 将HTML5占位符文本添加到文本框.net
- 在ASP.NET MVC中通过URL路由实现对多语言的支持
- asp.net – 哪个更快…… XSLT宏或.NEt用户控件
- 详解ASP.NET Core 2.0 视图引擎(译)
- asp.net-mvc-2 – 从MCV2视图中的模型集合中读取DataAnnota
- asp.net – 什么是SNIReadSyncOverAsync,为什么需要很长时间
- asp.net – WebForms中的强类型容器
推荐文章
站长推荐
- asp.net – Visual Studio 2015的项目模板
- razor – ASP.NET mvc使用IEnumerable模型和输入
- asp.net-mvc-4 – Web API 2返回OK响应,但在后台
- asp.net-mvc-2 – 将EDMX文件移动到新项目导致:
- ASP.NET是否需要ActiveX?
- asp.net – 如何以编程方式覆盖web.config设置
- asp.net-mvc – MVC / Unity – 如何将依赖项注入
- asp.net-mvc – 将匿名对象从视图传递到部分视图
- asp.net – 与WebAPI异步时保留HttpContext(中等
- asp.net – 我什么时候应该使用Webservice属性Sy
热点阅读