我在 SSRS 2008 R2
中有一些简单的报告,但它们根本不会在 Safari 或 Chrome 中显示。根据微软的在线图书,这些浏览器的支持方式有限。但是,数据“加载”时钟完成后我看不到任何内容。页面顶部的参数栏和面包屑导航部分都在那里。此外,我可以在 Safari 和 Chrome 上保存/导出为任何格式。它只是不会显示报告部分本身,它只是空白。
我是否应该使用证书和安全连接(当前未使用 HTTPS 设置,仅使用 HTTP)?是否有任何服务器端配置需要调整?有没有人使用以前的 SSRS 版本(2005)在 Safari/Chrome 上成功显示任何报告?
我使用的是 Safari 5.0.4
和 Chrome 10.0.648.151
。我知道这两个浏览器的相似之处在于它们都基于 WebKit .
该报告在 Internet Explorer 8(当然)和 Firefox 4.0 上成功呈现。
如果有人能阐明这一点,我将非常感激。
最佳答案
终极解决方案(也适用于 SSRS 2012!)
将以下脚本附加到“C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js”(在 SSRS 服务器上):
function pageLoad() {
var element = document.getElementById("ctl31_ctl10");
if (element)
{
element.style.overflow = "visible";
}
}
实际上,我不知道 div 的名称是否始终为 ctl31_ctl10
:在我的情况下,它是(而不是在 SQL Server 2012 azzlak 中找到 ctl32_ctl09
)。
如果此解决方案不起作用,请通过浏览器查看 HTML 以查看脚本是否正常工作,将 overflow:auto 属性更改为 overflow:visible .
<小时/>ReportViewer控件解决方案
将此样式行插入 .aspx
页面(或插入链接的 .css
文件,如果可用):
#reportViewer_ctl09 {
overflow:visible !important;
}
<小时/>
原因
Chrome 和 Safari 以与 Internet Explorer 不同的方式呈现 overflow:auto。
SSRS HTML is QuirksMode HTML and depends on IE 5.5 bugs. Non-IE browsers don't have the IE quirksmode and therefore render the HTML correctly
SSRS 2008 R2 报表生成的 HTML 页面包含一个具有 overflow:auto 样式的 div,它将报表变成不可见的报表。
<div id="ctl31_ctl10" style="height:100%;width:100%;overflow:auto;position:relative;">
...</div>
手动更改(使用 Chrome 的调试窗口)最终 HTML overflow:auto 在 overflow:visible 中,我可以在 Chrome 上看到报告。
我爱Tim's solution ;它既简单又有效。
但仍然存在一个问题:每当用户更改参数(我的报告使用参数!)AJAX 刷新 div 时,overflow:auto 标记就会被重写,并且没有脚本会更改它。 This technote detail解释了问题所在。
This happens because in a page built with AJAX panels, only the AJAX panels change their state, without refreshing the whole page. Consequently, the OnLoad events you applied on the tag are only fired once: the first time your page loads. After that, changing any of the AJAX panels will not trigger these events anymore.
einarq 先生向我建议了解决方案 here .
Another option is to rename your function to pageLoad.
如果页面上存在具有此名称的任何函数,那么 ASP.NET Ajax 将自动调用该函数,并且在每次部分更新后也是如此。如果这样做,您还可以从 body 标记中删除 onload 属性
因此,我编写了解决方案中所示的改进脚本。
关于reporting-services - SSRS 2008 R2 - SSRS 2012 - ReportViewer : Reports in Safari/Chrome but works fine in Firefox/Internet Explorer 8. ..为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5428017/