【问题标题】:No image in html report output generated with DynamicJasper API使用 DynamicJasper API 生成的 html 报告输出中没有图像
【发布时间】:2012-10-10 15:50:00
【问题描述】:

我正在使用 DynamicJasper API 构建报告,并且我想在列中插入图像。

我有:

FastReportBuilder drb = new FastReportBuilder();
drb.addImageColumn("Image", "image", "java.awt.Image", 500,false, ImageScaleMode.NO_RESIZE, detailStyle);

“图像”的属性是从 URL 构建的:

Image image = ImageIO.read(new URL(pathToImage));

我遇到的问题是图像显示在 PDF 输出中,但不在 HTML 输出中。检查生成的源代码,我看到以下内容:

<img src="nullimg_0_0_16" style="height: 50px" alt="">

【问题讨论】:

标签: java jasper-reports dynamic-jasper


【解决方案1】:

感谢 Alex K,但这不适用于 HTML 输出。

需要使用 jasper 的 ImageServlet。解决方案记录在这里:

http://dynamicjasper.com/2010/10/06/how-to-export-to-html/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-23
    • 2019-08-04
    • 1970-01-01
    • 2012-09-05
    • 1970-01-01
    相关资源
    最近更新 更多