使用jasperreports中的JRHtmlExporter类,用HTML浏览报表出现图片展示不出来问题,
private void exportToHTML(HttpServletRequest request,
HttpServletResponse response, JasperPrint jasperPrint)
throws JRException, IOException {
JRHtmlExporter exporter = new JRHtmlExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, response.getWriter());
// 是否用图片来对齐 如果true的话会用图片来填充空白区域 这里要用false
exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);
// 是否隐藏空的字符 这里要用true,否则在界面上空对象会显示为null
exporter.setParameter(JRHtmlExporterParameter.IS_WRAP_BREAK_WORD, true);
// 图片路径
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "/images/");
exporter.exportReport();
}
HTML中的图片展示不出来,查看图片的属性,
路径是http://10.38.144.159:8080/custcare/custsvc/commonbusiness/nullimg_0_0_0
本地采用绝对路径,后面也会跟一个img_0_0_0,
求各位大侠的帮助,需要在Java中设置什么属性吗?