润乾报表开发

     工作中有机会接触到润乾报表,把这几个月的开发经历记录下,以备刚刚接触润乾报表的朋友一点帮助。

版本是 润乾报表4.0

先将设计好的报表放到项目的WEB-INF/reportFiles目录下。

页面中代码,当然也可以写到action 中。

<%@ taglib uri="/WEB-INF/runqianReport4.tld" prefix="report"%>



<%

  request.setCharacterEncoding("UTF-8");

  String reportFile = "DataAnalyze/sameCityGrade.raq";  //报表路径,WEB-INF/reportFiles目录下

  String city = request.getParameter("city");



  city = (city==null||"".equals(city))?"北京":city;



  String grade  = request.getParameter("grade");

  grade  =  (grade==null||"".equals(city))?"1":grade;

  String params = "city=" + city;  //设置参数

  params += ";pollution=" + grade;

  request.setAttribute("grade",grade);

  

  request.setAttribute("city",city);

  

  CityDayDao cdd = new CityDayDaoImpl();

  List cities = cdd.city();

  request.setAttribute("cities",cities);



%>
//引入报表标签



    <report:html name="report1" 

    reportFileName="<%=reportFile%>"

    funcBarLocation=""

	params="<%=params%>" 

    width="-1" height="-1" />

你可能感兴趣的:(html,String,report,null,action,报表)