开发者

How to print the jasper report on console

request.getSession().setAttribute("IMAGES_MAP", imagesMap);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "" + request.getContextPath() + "//image?image=");

exporter.setParam开发者_JAVA百科eter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outStream);

After this I set the out to a iframe and it works fine.

Before sending the exported html page I want the html page to be printed in console because when the same report is viewed in pdf the colors come but the colors do not come in html format.


JasperExportManager.exportReportToHtmlFile method allows you to export the html to a file and you may use the Apache Commons FileUtils readFileToString(new File(destinationHtmlFile)) to get the contents of the file as a string which you may print on the console

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜