zoukankan      html  css  js  c++  java
  • 客制化jasperreport导出html的过程

    *

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

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

    *

    有问题在公众号【清汤袭人】找我,时常冒出各种傻问题,然一通百通,其乐无穷,一起探讨


  • 相关阅读:
    [HDU] 2084 数塔 入门dp
    一些实用的小技术,不定时更新^_^
    上传图片的综合验证
    一个典型web接口处理
    js控制背景音乐播放
    心开始平和起来
    冲突域广播域
    可怜的我的啊~~
    祈祷
    昨夜小楼又东风...
  • 原文地址:https://www.cnblogs.com/qingmaple/p/5955098.html
Copyright © 2011-2022 走看看