父页面传参到iframe嵌套的报表
有时客户需要向嵌套报表的iframe的传递参数,我们可以使用js传递,示例代码如下:
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=euc-kr” />
<title>iframe</title>
<script language=”javascript”>
function goIframe(){
var form = document.form1;
var arg1 = form.arg1.value;
var ifr = document.all(“result”);
window.result.location.href=ifr.src +”&arg1=” + arg1;
}
</script>
</head>
<body>
<form id=”form1″ name=”form1″ method=”post” action=”">
arg1:<input name=”arg1″ type=”text” id=”arg1″ size=”15″ />
<input type=”button” name=”Submit” value=”button” onclick=”javascript:goIframe();” />
</form>
<iframe name=”result” id=”result” marginheight=”0″ marginwidth=”0″ frameborder=”0″ height=”900″ width=”900″ scrolling=”no” src=”http://192.168.0.143:6002/demo/reportJsp/showReport.jsp?raq=/report_0.raq”>
</iframe>
</body>
</html>
在web中查看效果,参数模板和父页面都可以向报表传递参数: