参数不同展现报表不同
应用场景
用户有多张报表,根据输入的参数不同,展现的报表也不同
润乾报表是很容易实现的,在展现报表的jsp页面中,做一下判断就可以了。
下面是jsp页面的例子
<%@ page contentType=”text/html;charset=GBK” %> 
<%@ page import=”java.sql.*”%> 
<%@ page import=”java.util.Hashtable”%> 
<%@ taglib uri=”/WEB-INF/runqianReport4.tld” prefix=”report” %>
<% 
String reportParamsId = request.getParameter(“reportParamsId”); 
Hashtable params = null; 
if(!”".equals(reportParamsId) && reportParamsId != null){ 
params = com.runqian.report4.view.ParamsPool.get( reportParamsId ); 
}
String reportName = “test1.raq”;
if(params != null){ 
String paramValue = (String) params.get(“arg1″); 
if(“xrq1″.equals(paramValue)){ 
reportName = “test1.raq”; 
}else if (“xrq2″.equals(paramValue)){ 
reportName = “test2.raq”; 
}else if (“xrq3″.equals(paramValue)){ 
reportName = “test3.raq”; 
%>
<html> 
<head> 
</head> 
<body>
<table > 
<tr><td> 
<report:param name=”form1″ paramFileName=”test1_arg.raq” 
needSubmit=”no” 
/> 
</td></tr> 
</table>
<table > 
<tr><td> 
<report:html name=”report1″ reportFileName=”<%=reportName %>” 
needPageMark=”no” 
/> 
</td></tr> 
</table>
</body> 
</html>