I'm getting an exception during compile in Jaspersoft Studio 6.4.0. How do I address this?
I've created a report containing a subreport from which I want to return a value. To do that, I have:
On compile, I'm seeing the following exception:
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.
I can choose the "System" choice from a If I use other choices ("No calculation function," "First," "Average," etc.), the subreport returns null.
Main Report:
<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>
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>
It seems that the exception is the result of a mismatch between what JS Studio permits and what this particular compiler (not sure whether JSS uses the compiler I installed (6.4.1) or one that it installs) allows.
Obviously, the solution is to ensure that the compiler being used is compatible.