IE9下通过Iframe引入BIRT显示空白

解决办法一

 http://my.oschina.net/lhplj/blog/191825

这种解决办法是强制更改浏览器的渲染模式,虽然可以解决BIRT在iframe下不显示的问题,但同时会带来其它界面上的显示问题。

解决办法二:

IE9下通过iframe引入BIRT不显示时,查看前台控制台发现

可在webcontent/birt/ajax/ui/report/下找到AbstractBaseReportDocument.js文件,并找到如下

this.__instance.style.left = containerLeft + "px";

		if (BrowserUtility.isIE) {
			var reportContainer = this.__instance.firstChild;

			if (reportContainer != null) {
				var scrollBarWidth = BrowserUtility._getScrollBarWidth(reportContainer, width, height);
				var containerWidth = "100%";

				if (height < reportContainer.offsetHeight && width > scrollBarWidth) {
					containerWidth = (width - scrollBarWidth) + "px";
				}
				reportContainer.style.overflowX = "visible";
				reportContainer.style.overflowY = "visible";
				reportContainer.style.position = "relative";
				reportContainer.style.width = containerWidth;
			}
		}

将其修改为

this.__instance.style.left = containerLeft + "px";
		var mddv = document.documentMode;
		if (BrowserUtility.isIE && mddv >=9) {
			//IE9或更高的不需要任何处理
		} else if (BrowserUtility.isIE) {
			var reportContainer = this.__instance.firstChild;

			if (reportContainer != null) {
				var scrollBarWidth = BrowserUtility._getScrollBarWidth(reportContainer, width, height);
				var containerWidth = "100%";

				if (height < reportContainer.offsetHeight && width > scrollBarWidth) {
					containerWidth = (width - scrollBarWidth) + "px";
				}
				reportContainer.style.overflowX = "visible";
				reportContainer.style.overflowY = "visible";
				reportContainer.style.position = "relative";
				reportContainer.style.width = containerWidth;
			}
		}

之后保存,清空IE缓存再次查看就发现问题解决了。(如果还没出来,通过IE控制台查看脚本文件加载的是否是修改后的,IE有点恶心,想不明白原因,后台部署的项目中的脚本都已经改过了,即使清空了缓存,还是加载原来的)。





转载于:https://my.oschina.net/lhplj/blog/223695

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值