【问题标题】:Can we use compiled .jasper file in iReport API to generate reports?我们可以在 iReport API 中使用已编译的 .jasper 文件来生成报告吗?
【发布时间】:2013-03-09 06:05:30
【问题描述】:

为什么我们要使用 .jrxml 文件并在每次生成报告时在代码中编译它。

我们可以使用已经编译好的 .jasper 文件使用 iReport API 来生成报告吗?

谁能帮我解决这个问题?

【问题讨论】:

  • Why do we use .jrxml file and compile it within the code evertime the report has to be generated. - “编译或不编译”由您选择

标签: jasper-reports ireport


【解决方案1】:

是的,您可以使用已编译的 .Jasper 文件在 iReport 中生成报告。 如果我在 iReport 中打开一个 .Jasper 文件,它会自动为同一个 .Jasper 文件生成一个 .JRXML 文件,然后您就可以生成报告了。

【讨论】:

    【解决方案2】:

    是的,如果不更改模板,则不需要编译 .jrxml 文件。

    private String jasperFile = "/path/to/yourReport.jasper";
    jasperPrint = JasperFillManager.fillReport(jasperFile,
                    reportParametrs,
                    dataSource);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多