[#2628] - Value Axis Tick Label Mask not saved

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

The Value Axis Tick Label Mask on all my charts are not saved. Each time i open iReport(5.0.0) and preview any report with charts i had previously made they are missing their Value Axis Tick Label Mask value

v5.0.0
swarm357's picture
Joined: May 31 2012 - 9:48am
Last seen: 7 years 7 months ago

4 Comments:

#1
  • Assigned:nobody»

Hi I raise this bug in 4.7 also, but I handle there by some workaround what i did is value axis tick label mask adjust from xml code of the report .
write a code <valueAxisFormat>
<axisFormat tickLabelMask="0.00"/>
</valueAxisFormat>

and save report from xml window then go to the designer window the export it to the repository and remember that make this changes last when report is ready beacouse if you make any change in reports then charts changes revert from the code.

#2
  • Assigned:» anonymous

Hey,
I have tried your workaround, but for some reason it cause iReports to see the report template as invalid after i add the lines

<valueAxisFormat>
<axisFormat tickLabelMask="¤ #,##0"/>
</valueAxisFormat>

here is a snippet of the relevant section of my xml after i added your suggested xml.

...
<linePlot isShowShapes="true">
<plot labelRotation="-45.0"/>
<rangeAxisMaxValueExpression><![CDATA[$V{chargeMax}]]></rangeAxisMaxValueExpression>
<valueAxisFormat>
<axisFormat tickLabelMask="¤ #,##0"/>
</valueAxisFormat>
</linePlot>
...

After i save and then go back to the design view i get the following message in a popup window:

Error loading the report template

Message:
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException; lineNumber: 656; columnNumber: 50; cvc-complex-type.2.4.d: Invalid content was found starting with element 'valueAxisFormat'. No child element is expected at this point.
Level:
SEVERE
Stack Trace:
org.xml.sax.SAXParseException; lineNumber: 656; columnNumber: 50; cvc-complex-type.2.4.d: Invalid content was found starting with element 'valueAxisFormat'. No child element is expected at this point.
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:247)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:230)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:218)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

...

Any idea why this happens? Any suggestions?

Thank you for your response!

#3

Nevermind ... i found another way to work around this issue. i ended up using some java to customize my chart. It looks something like this:

public class MyCustomizer implements JRChartCustomizer {

@Override
public void customize(JFreeChart chart, JRChart jasperChart) {
NumberAxis numAxis = (NumberAxis) chart.getCategoryPlot().getRangeAxis();
numAxis.setNumberFormatOverride(new DecimalFormat("#,##0"));
}
}

Thanks

#4
  • Assigned:nobody»

Thanks for your reply I also get another way of doing that change. In my case add the code after </linechart> or </barchart>.
But your solution id better.

Thanks

Feedback