[#11431] - Custom Visualization Component dataset does not reset when grouping

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

The initial group contains the correct amount of rows given the group expression however subsequent groups always contain all data received from previous groups.

For instance, using the following group expression

$V{REPORT_COUNT} - 1 - ( ($V{REPORT_COUNT} - 1) % 10 )

each group should contain 10 rows of data. Using the Custom Visualization Component (CVC) 6.7.0 the first group contains the initial 10 rows of data, however the next group contains the first group plus the second group of data, the group after contains the data from the first group and second group plus the third group of data, and so on.

The CVC was placed in the group footer in the same way that one would place a standard chart (e.g. https://stackoverflow.com/questions/14516654/how-to-split-chart-into-mul...) and the data set was tagged to reset on the created group.

For example, the group tag looks like:

...
<group name="Group1">
<groupExpression><![CDATA[$V{REPORT_COUNT} - 1 - ( ($V{REPORT_COUNT} - 1) % $P{numBandsPerChart} )]]></groupExpression>
<groupHeader>
<band height="50"/>
</groupHeader>
<groupFooter>
<band height="363">
<componentElement>
<reportElement isPrintRepeatedValues="false" x="0" y="0" width="800" height="363" uuid="13ab2a5e-2b23-4f85-84a6-133884f4fca5"/>
<cvc:customvisualization xmlns:cvc="http://www.jaspersoft.com/cvcomponent" xsi:schemaLocation="http://www.jaspersoft.com/cvcomponent http://www.jaspersoft.com/cvcomponent/component.xsd">
<cvc:itemProperty name="script">
<valueExpression><![CDATA[$P{templateDirectory} + "/scripts/<my script>.min.js"]]></valueExpression>
</cvc:itemProperty>
<cvc:cvData>
<dataset resetType="Group" resetGroup="Group1"/>
<cvc:item>
<cvc:itemProperty name="field1">
<valueExpression><![CDATA[$F{field1}]]></valueExpression>
</cvc:itemProperty>
</cvc:item>
</cvc:cvData>
</cvc:customvisualization>
</componentElement>
</band>
</groupFooter>
</group>
...

v6.7.0
Custom Visualization Component
tony_33's picture
Joined: Jan 11 2018 - 3:22pm
Last seen: 3 years 3 months ago
Feedback
randomness