標籤:
*
先看一段簡單的匯出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%\"> </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的過程