跨域调用报表展现页面的flash打印方法
2016-11-24 17:10
549 查看
环境说明:
项目的应用和润乾的报表应用分别部署在同一机器不同的web服务器上(IP相同,端口不同,项目的端口8080,报表应用的端口是6868)。
在项目中的父页面通过iframe调用报表展现页面。
在父页面中调用润乾中的flash打印的JS方法进行flash打印。
调用方式:
写了个简单的测试页面parent.html,将其放到非报表应用中进行测试,在非报表应用中的parent.html中通过document.getElementById("myFrame").contentWindow.report1_flashPrint();调用报表的flash打印功能。
parent.html的代码如下:
<html>
<head>
<script type="text/javascript">
function callChild(){
alert("flashPrint2");
document.getElementById("myFrame").contentWindow.report1_flashPrint();
}
</script>
</head>
<body>
<input id="button" type="button" value="调用报表应用中的flash打印函数" onclick="callChild()"/>
<iframe id="myFrame" name="myFrame" src="http://192.168.0.55:6868/demo/reportJsp/preview.jsp?rpx=%2Ftest.rpx&rpxHome=E%3A%2FProgram+Files%2Fraqsoft_1115%2Freport%2Fwebapps%2Fdemo%2FWEB-INF%2FreportFiles&dfxHome=E%3A%2FProgram+Files%2Fraqsoft_1115%2Freport"></iframe>
</body>
</html>
环境说明:
项目的应用和润乾的报表应用分别部署在同一机器不同的web服务器上(IP相同,端口不同,项目的端口8080,报表应用的端口是6868)。
在项目中的父页面通过iframe调用报表展现页面。
在父页面中调用润乾中的flash打印的JS方法进行flash打印。
调用方式:
写了个简单的测试页面parent.html,将其放到非报表应用中进行测试,在非报表应用中的parent.html中通过document.getElementById("myFrame").contentWindow.report1_flashPrint();调用报表的flash打印功能。
parent.html的代码如下:
<html>
<head>
<script type="text/javascript">
function callChild(){
alert("flashPrint2");
document.getElementById("myFrame").contentWindow.report1_flashPrint();
}
</script>
</head>
<body>
<input id="button" type="button" value="调用报表应用中的flash打印函数" onclick="callChild()"/>
<iframe id="myFrame" name="myFrame" src="http://192.168.0.55:6868/demo/reportJsp/preview.jsp?rpx=%2Ftest.rpx&rpxHome=E%3A%2FProgram+Files%2Fraqsoft_1115%2Freport%2Fwebapps%2Fdemo%2FWEB-INF%2FreportFiles&dfxHome=E%3A%2FProgram+Files%2Fraqsoft_1115%2Freport"></iframe>
</body>
</html>
相关文章推荐
- facebook页面种简单测试js调用flash开放的js接口的方法
- js调用iframe实现打印页面内容的方法
- JavaScript实现内嵌的iframe跨域调用父页面js方法
- 跨域调用iframe父页面的方法
- JavaScript中跨域调用Flash的方法
- js调用iframe实现打印页面内容的方法
- 调用浏览器的打印方法打印页面内容
- 关于在iframe中,跨域调用parent页面的方法的问题
- JavaScript中跨域调用Flash的方法
- JavaScript中跨域调用Flash的方法
- FLASH调用网页上的JS方法,以及FLASH全屏播放的方法
- 最好不要在页面(.aspx)对上层方法进行调用
- 在页面没有完全加载完毕前调用Ajax方法会出错
- 在页面没有完全加载完毕前调用Ajax方法会出错
- 在ASP程序中打印Excel报表的新方法
- 在页面没有完全加载完毕前调用Ajax方法会出错
- JSP页面的验证码生成及调用方法
- Crystal Report(RDC8) 水晶报表在VC6环境中的调用方法
- [原创]如何在关闭当前页面时刷新父页面(调用它的页面),或者触发父页面的某个事件或方法
- 在页面没有完全加载完毕前调用Ajax方法会出错