首页 > Web开发 > 详细

客制化jasperreport导出html的过程

时间:2016-10-13 09:30:18      阅读:329      评论:0      收藏:0      [点我收藏+]

*

先看一段简单的导出html过程中,修改html头部的例子:【jasperreport6.3.1】

HtmlExporter exporter = new HtmlExporter();
       
        SimpleHtmlExporterConfiguration config=new SimpleHtmlExporterConfiguration();
        
        
           String header= "<html>\n"+
            "<head>\n"+
            "  <title></title>\n"+
            "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n"+
            "  <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jasper.css\" />\n"+
            "  <style type=\"text/css\">\n"+
            "    a {text-decoration: none}\n"+
            "  </style>\n"+
            "</head>\n"+
            "<body text=\"#000000\" link=\"#000000\" alink=\"#000000\" vlink=\"#000000\" bgcolor=\"gray\">\n"+
            "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"+
            "<tr><td width=\"50%\">&nbsp;</td><td align=\"center\">\n";
            
            config.setHtmlHeader(header);
            config.setBetweenPagesHtml("");//设置每页之间没有空行
            
        
        exporter.setConfiguration(config);
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleHtmlExporterOutput(pdfPath));
        exporter.exportReport();

 

*

客制化jasperreport导出html的过程

原文:http://www.cnblogs.com/qingmaple/p/5955098.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!