【问题标题】:How to enable export to HTML format at JasperReports Server如何在 JasperReports 服务器上启用导出为 HTML 格式
【发布时间】:2017-02-09 02:23:35
【问题描述】:

我需要使用 JasperReports Server 以 HTML 格式导出报告。 JasperReport Server 提供导出为多种格式(pdf、xls、csv、docx、rtf、odt、...)的选项,但不包括 HTML。

iReport 预览中可以导出为 HTML 格式,但在我加载 jrxml 文件时,JR 服务器 中不可用。

我需要做什么或更改才能使 HTML 导出选项可用?

【问题讨论】:

    标签: html jasper-reports jasperserver


    【解决方案1】:

    JasperReports Server 中没有这样的选项(我检查了 6.2.05.5 版本)。

    您可以查看 WEB-INF\flows 文件夹中的 viewReportBeans.xml 配置文件。

    它包含这个块:

    <util:map id="exporterConfigMap">
        <!-- comment/uncomment any of the lines below if you want related exporters 
             to be excluded/included in the viewer's exporters list
             Note: separate configuration for iPad 'exportersSupportedByiPad'
             -->
    
        <entry key="pdf" value-ref="pdfExporterConfiguration"/>
        <entry key="xls" value-ref="xlsExporterConfiguration"/>
        <entry key="xlsNoPag" value-ref="xlsNoPaginationExporterConfiguration"/>
        <entry key="csv" value-ref="csvExporterConfiguration"/>
        <entry key="docx" value-ref="docxExporterConfiguration"/>
        <entry key="rtf" value-ref="rtfExporterConfiguration"/>
        <entry key="odt" value-ref="odtExporterConfiguration"/>
        <entry key="ods" value-ref="odsExporterConfiguration"/>
        <entry key="xlsx" value-ref="xlsxExporterConfiguration"/>
        <entry key="xlsxNoPag" value-ref="xlsxNoPaginationExporterConfiguration"/>
        <entry key="pptx" value-ref="pptxExporterConfiguration"/>
        <!-- 
        <entry key="txt" value-ref="txtExporterConfiguration"/>
        -->
    </util:map>
    

    您可以在此处禁用某些导出器。但是如果你想添加新的(html 在你的情况下) - 你应该更改 JR Server 的源代码以添加对这种格式的支持。

    在为 JRS 实施 html 导出器时,您可能会遇到一些困难。例如,如何处理报表中的图片(外部资源)。

    【讨论】:

    • 感谢您的回复。幸运的是,我发现执行调度报告生成,我可以导出为 HTML 格式,这解决了我的问题。我很抱歉我的英语不太流畅。问候。
    猜你喜欢
    • 1970-01-01
    • 2013-10-26
    • 2011-11-16
    • 2012-05-29
    • 1970-01-01
    • 1970-01-01
    • 2012-01-24
    • 2010-11-08
    • 1970-01-01
    相关资源
    最近更新 更多