【问题标题】:coldfusion cfreport error when format is excel格式为excel时coldfusion cfreport错误
【发布时间】:2011-02-10 03:50:01
【问题描述】:

使用格式为 excel 的 cfreport 时遇到问题。即使 *.cfr 文件仅包含单个标签也会发生此错误。

<cferror template="path/to/error_template.cfm" type="EXCEPTION">

<cfreport template="path/to/cfr_file.cfr" format="excel">
    <cfreportparam name="param1" value="value1">
    <!--- several cfreportparam tag --->
</cfreport>

来自自定义错误模板,

  • 诊断:(类:net/sf/jasperreports/engine/export/JRXlsExporter,方法:createMergeRegion 签名:(Lnet/sf/jasperreports/engine/export/JRExporterGridCell;IILorg/apache/poi/hssf/ usermodel/HSSFCellStyle;)V) 函数参数不兼容 null
    错误发生在第 -1 行。
  • 消息:(类:net/sf/jasperreports/engine/export/JRXlsExporter,方法:createMergeRegion 签名:(Lnet/sf/jasperreports/engine/export/JRExporterGridCell;IILorg/apache/poi/hssf/ usermodel/HSSFCellStyle;)V) 函数参数不兼容

只有格式为excel时才会出现此错误

谢谢你:)

【问题讨论】:

    标签: excel coldfusion reportbuilder


    【解决方案1】:

    查看诊断消息,似乎 CF 正在调用 Jasper Reports 来生成您的报告,并且在内部调用 Apache POI。然而,CF 在寻找正确的 Java 方法来调用时遇到了问题。

    这可能是 cfreport 标记中的错误,但出现此类异常的最可能原因是您的 ColdFusion 类路径中有多个 Jasper 报告或 POI jar 副本。然后发生的事情是 CF 选择了错误的 Jar,尝试在旧/新 jar 上调用新/旧方法,但失败了。我建议您检查您的类路径并确保您那里只有最新的 jar,或者只有 CF 提供的那些,但不是我怀疑您目前拥有的两个副本。

    请参阅this 以获取有关如何获取 CF 从中加载 java 类的 jar 文件的示例

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-09
      相关资源
      最近更新 更多