具有 return 值的子报表给出异常 "System is not facet valid with enumeration"

Subreport with return value gives exception "System is not facet valid with enumeration"

我在 Jaspersoft Studio 6.4.0 中编译时遇到异常。 我该如何解决这个问题?

我创建了一个包含子报表的报表,我想从中 return 一个值。为此,我有:

  1. 在名为 "logTotal" 的子报表中创建了一个变量,设置为 另一个变量的值,它是在 报告。无复位型,无计算功能
  2. 在主报表中创建了一个具有相同名称和类型的变量。 无复位型,无计算功能
  3. 在主报表中,创建了子报表return值link 计算类型的两个变量之间,"System."

编译时,我看到以下异常:

net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException; lineNumber: 454; columnNumber: 91; cvc-enumeration-valid: 
Value 'System' is not facet-valid with respect to enumeration '[Nothing, Count, DistinctCount, Sum, Average, Lowest, Highest, StandardDeviation, Variance, First]'. It must be a value from the enumeration.

我可以选择"System"选项 如果我使用其他选择("No calculation function," "First," "Average," 等), 子报表 return 为空。

主要报告:

<variable name="logTotal" class="java.math.BigDecimal" resetType="None"/>
...
<subreport>
    <reportElement positionType="Float" x="0" y="60" width="572" height="40" uuid="d3ec84fb-528f-41f5-8b54-26112fd95b50"/>
    <subreportParameter name="loadList">
        <subreportParameterExpression><![CDATA[$P{loadList}]]></subreportParameterExpression>
    </subreportParameter>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <returnValue subreportVariable="logTotal" toVariable="logTotal" calculation="System"/>
    <subreportExpression><![CDATA["scaling/reports/ScaleSummary_Logs.jasper"]]></subreportExpression>
</subreport>

子报表:

<variable name="price4" class="java.math.BigDecimal" calculation="Sum">
    <variableExpression><![CDATA[$F{price}]]></variableExpression>
</variable>
<variable name="logTotal" class="java.math.BigDecimal" resetType="None">
    <variableExpression><![CDATA[$V{price4}]]></variableExpression>
</variable>

异常似乎是 JS Studio 允许的内容与此特定编译器(不确定 JSS 是使用我安装的编译器 (6.4.1) 还是它安装的编译器)允许的不匹配的结果。

显然,解决方案是确保所使用的编译器兼容。