.net集成
1. 问题描述
报表部署到Web应用服务器如tomcat后,我们就可以在BS浏览器中调用报表了,但是还需要嵌入到.net系统中,通过.net系统的入口调用报表。
比如点击.net系统左侧目录树的报表节点时,将报表显示在中间区域等等。
2. 情形一:报表整体嵌入在.net系统框架中
如下图,点击左侧报表节点,将报表整体显示在.net系统的MainFrame主框架中:
图中“地区销售表”对应一个超级链接元素<a>,我们只需要设置其href为报表路径,目标打开位置target为框架名称MainFrame即可:
<a href="http://localhost:8080/WebReport/ReportServer?reportlet=GettingStarted.cpt" target="MainFrame">地区销售表</a>
另外还可以给报表传递动态参数值,类似如下:
<a href="http://localhost:8080/WebReport/ReportServer?reportlet=GettingStarted.cpt&参数名=<%=参数值%>" target="MainFrame">地区销售表</a>
3. 情形二:报表嵌入在.net系统的某个页面中
若上图中间区域主框架中嵌入的是某个.net页面,如xxx.asp,在该页面中再嵌入报表。此时在该asp页面body中通过iframe来嵌入报表:
<iframe id="reportFrame" src="http://localhost:8080/WebReport/ReportServer?reportlet=GettingStarted.cpt" width = "100%" height = "500px"></iframe>