7.8 Reporting questions


I have noticed some of the functionality of the old reporting system appears to be gone in the new version, though possibly there are ways to script the old functionality? Below are specific questions and screen shots showing the report differences…

  1. In the old version, you could format specific sections of a text field but the new version appears to only allow formatting for the entire field. Is there any way to format numbers that are in the same text field differently?

  2. In the old bar chart tool, you could custom design the data labels for each chart - for instance have a data label which had both downtime and number of occurrences. Is this still possible?

  3. Is there any way to format the data label number format on a bar chart?

  4. In the old version, the chart tools allowed manipulation of the chart area to allow additional space for long category labels, like alarm names, but the new version appears to only truncate long labels. Is it possible to either wrap labels or allow the chart to auto-shrink to fit the labels?

Any assistance would be appreciated!

  1. When we rewrote reporting, we originally allowed formatting per number, but the UI quickly became totally unusable. Since the UI was the number one complaint about the old reporting system, we made the decision to sacrifice the per-number (and per-date) formatting. One work around is to format the number before it comes in, and bring it in as a string.

2-4 The new charts are based on JFreeChart, and through the scripting options you have access to just about everything. In the Chart Options tab of the property inspector, scroll to the bottom, click Enabled under scripting, and click on Edit Script. JFreeChart API

Thank you for the reply, Kathy! Your recommendation for pre-formatting the numbers and returning them as strings should do the trick for the formatting question, but I am still not sure how to custom format the charts - even doing something as simple as adding a title appears to require a script, but he “ConfigureChart” method does not appear to be in the jfreechart documentation and none of the online tutorials have any info on the scripts… Will the chart scripting options be documented in the manual or in a tutorial at some point? I have been unable to connect to the online manual, it appears to be offline or a bad link, so maybe there is info there already…

ConfigureChart is our method, but in that you have access to a chart object, which is what’s in the JFreeChart documentation.

The online manual link has been working fine for me at docs.inductiveautomation.com. If you’re not able to connect, check with your IT department and see what’s going on there.

I’ll pass along to the training department that you’d like to have more info on configuring charts via scripting in the docs. I doubt there will be a comprehensive list of everything you can do, but they could probably put up an example or two to get people started.


Thanks - that link works, but the link below on your user manual support page does not… docs.inductiveautomation.com:84 … ser+Manual

Thanks! I’ll let our web people know.

In the mean time, here’s a small example script to help you get started on scripting charts, along with links to the APIs for each line in the comments. You’ll need to spend some time reading through the API to get a feel for what you can do, but this will give you a starting point for experimenting.

[code]def configureChart(chart):

This configures the legend on a report chart to use a large, bold, monospaced font

from java.awt import Font

legend = chart.getLegend() # http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
font = Font(Font.MONOSPACED, Font.BOLD, 48) # https://docs.oracle.com/javase/7/docs/api/java/awt/Font.html
legend.setItemFont(font) # http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/title/LegendTitle.html

Thank you very much, Kathy!