java code
try
                {
                //生成Chart数据
                ArrayList<ChartBean> data = new ArrayList<ChartBean>(5);
                data.add(new ChartBean("小学", 5));
                data.add(new ChartBean("初中", 10));
                data.add(new ChartBean("高中", 15));
                data.add(new ChartBean("本科", 20));
                data.add(new ChartBean("研究生",15));              JRDataSource dataSource = new JRBeanCollectionDataSource(data);              // 获取报表模板文件
              String root_path = this.getServlet().getServletContext().getRealPath("/");
              root_path = root_path.replace('\\', '/');
              String reportFilePath = root_path + "WEB-INF/classes/com/myapp/ireport/report_2.jasper" ;
              System.out.println( "jasper file is " + reportFilePath);java code

解决方案 »

  1.   

    [java code ]try 
                    { 
                    //生成Chart数据 
                    ArrayList <ChartBean> data = new ArrayList <ChartBean>(5); 
                    data.add(new ChartBean("小学", 5)); 
                    data.add(new ChartBean("初中", 10)); 
                    data.add(new ChartBean("高中", 15)); 
                    data.add(new ChartBean("本科", 20)); 
                    data.add(new C…
    [/java code]