Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual
Page 267

9
•
ReportsPlus
267
Example
This example Multi-Purpose Report script creates a trend chart with three data series. The
first data series will be displayed as a bar chart and the second and third data series will be
displayed as trend lines.
Dim trendChart As New TrendChart()
trendChart.SeriesType = SeriesType.Bar
trendChart.AddData("Jan", 100)
trendChart.AddData("Feb", 200)
trendChart.AddData("Mar", 300)
trendChart.NextSeries
trendChart.SeriesStacked = true
trendChart.AddData("Jan", 5420)
trendChart.AddData("Feb", 3500)
trendChart.AddData("Mar", 10405)
trendChart.NextSeries
trendChart.AddData("Jan", 3340)
trendChart.AddData("Feb", 5200)
trendChart.AddData("Mar", 1500)
Report.Add(trendChart, 3, 2, 5, 3)
Weeks Collection
The Weeks object is a collection of Week objects. The Weeks and Week objects provide
an easy way for MPR script code to process data in weekly periods.
Instancing
The Weeks object is a creatable object.
Accessing
The Report object automatically creates one Weeks object (accessible by using the
Report.Weeks property) and MPR script code can create additional Weeks objects if
needed.