星空报表
http://download.enet.com.cn/html/030212006012001.html
优点:
功能比较全面,可以作为独立的报表服务器使用,也可以内嵌到其他web应用中,输出格式包括pdf、excel、rtf等,支持任务订制、历史报表存储、在线自定义报表(WEB创作)等。
缺点:
免费使用

解决方案 »

  1.   

    楼上,那如果我想生成csv格式的报表,里面又有中文,有没有好的办法解决。您以前导出过csv这类格式的报表吗?
      

  2.   

    下载AsiaText后,pdf格式、xls格式、html格式都没有问题,偏偏这类纯文本格式的就会出乱码,怪!
      

  3.   

    csv格式导出很方便的,直接一个方法就可以我发一个你参考参考 public void toCsv(
            ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest httpServletRequest,
            HttpServletResponse httpServletResponse)
            throws Exception {      
            String fileName="employee_export.csv";
            httpServletResponse.setContentType( "application/file");
            httpServletResponse.setHeader("Content-disposition",  
                              "attachment; filename=" + fileName );
            MessageResources messageResources=getResources(httpServletRequest);
            
            try{
                   
                    StringBuffer content=new StringBuffer();
                    content.append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.label"))
                        .append('\n')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"web.common.sn"))
                        .append(',')    
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.zgxm"))
                        .append(',')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.dept"))
                        .append(',')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.qx"))
                        .append(',')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.yhm"))
                        .append(',')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.qzwjm"))
                        .append(',')
                        .append(messageResources.getMessage(this.getLocale(httpServletRequest),"employee.py"));                                
                    List employeeList=this.getCommonFacade().findByCriteria(DetachedCriteria.forClass(TbEmployee.class).setFetchMode(TbEmployee.PROP_BM_ID,FetchMode.JOIN));
                    int i = 1;                for (Iterator it =employeeList.iterator();it.hasNext();){
                        TbEmployee employee=(TbEmployee)it.next();                    content.append('\n')
                            .append(i).append(',')
                            .append(employee.getZgxm()).append(',')
                            .append(employee.getBmId().getBmmc()).append(',')
                            .append(StringUtil.getStrValue(employee.getQx())).append(',')
                            .append(StringUtil.getStrValue(employee.getYhm())).append(',')
                            .append(StringUtil.getStrValue(employee.getQzwjm())).append(',')
                            .append(StringUtil.getStrValue(employee.getPy())).append(',');
                        i++;
                    }
                    OutputStream bos = httpServletResponse.getOutputStream();               
                    byte[] buff = content.toString().getBytes();
                    bos.write(buff); 
                    bos.flush();
                    bos.close();
                }catch(Exception e){
                   e.printStackTrace();           
                }           
        } // end downLoad
      

  4.   

    web.common.sn等等这些都是你在资源文件里面定义的如:web.common.sn=序号
    employee.dept=部门
      

  5.   

    每一个显示要字体为宋体,misong,chinese simpliate
    就行了
      

  6.   

    to楼上:兄弟,要试试再给我这么说吧,这些东西我都设过了,没有效果的。反正现在这个需求不急,等我忙完这段时间,把iReport的源码看一下。
      

  7.   

    - -||
    我还自己去写了生成CSV的bean
      

  8.   

    结贴时漏了egg13(13er),下次再开帖时补给您