As of the release date of Elipse E3/Power version 6.6, a new object called Elipse E3/Power Section Report (E3SectionReport) was added to Elipse E3 Studio. It’s available both in 64- and 32-bit versions of Elipse E3.
In this article, we’ll present the new tool, and then its basic configuration features.
1. E3ApplicationLink
With this object, you can access values of Tags, Screens, and Viewer object directly via scripts, since you can’t use expressions in Labels/TextBox properties.
In order to use this object in a Section Report script, you must also create an instance to work as an interface between the Section Report and Elipse E3, as seen below.
Sub ActiveReport_ReportStart dim Application = Activator.CreateInstance(Type.GetTypeFromProgID("Reports.E3ApplicationLink")) Application.LinkWithApplication(rpt) End Sub
When adding a Section Report, the script adds automatically:
The object E3ApplicationLink is only available in Section Report’s scripts, since it uses Visual Basic .NET programming language.
1.1 E3Application Link methods
Therefore, the methods available in object E3ApplicationLink are:
- GetScreenValue(Path, [Frame], [Property]): This method only works at run time in Elipse E3 Viewer, and its function is to return the value of a property in a Screen or Frame. Path parameter is mandatory, and indicates the path to an object from a Screen or Frame. This parameter can be an empty string, and therefore it indicates the path to a Screen or Frame. Frame parameter is optional, and thus it indicates where the Frame or Screen is. When omitting this parameter, be sure to use _top Frame. Property parameter indicates the name of the property to return. By omitting this parameter, the value of Value property will return.
Example:
dim Application = Activator.CreateInstance(Type.GetTypeFromProgID("Reports.E3ApplicationLink")) Application.LinkWithApplication(rpt) Me.Label1.Text = Application.GetScreenValue("Pasta1.TagInterno1", "Inferior")
NOTE: By using “Me.”, you will have direct access to all objects and sections in the report with the autocomplete feature.
- GetServerValue(Path, [Property]): This method works both in E3 Studio and at run time, and its function is to return a server object’s property value. Path parameter is mandatory, and indicates an object’s path in the server. Property parameter indicates the name of the property to return. By omitting this parameter, the value of Value property will return.
Example:
dim Application = Activator.CreateInstance(Type.GetTypeFromProgID("Reports.E3ApplicationLink")) Application.LinkWithApplication(rpt) Me.Label2.Text = Application.GetServerValue("Dados.TagInterno1") Me.Label3.Text = Application.GetServerValue("Dados.TagInterno1", "Timestamp")
- GetViewerValue(Path, [Property]): This method works only at run time in Elipse E3 Viewer, and its function is to return the value of a property of Viewer object or of one of its children. Path parameter is mandatory, and it indicates the path to a Viewer’s child object. This parameter can be an empty string, and therefore it indicates a Viewer object’s property return. Property parameter indicates the name of the property to return. By omitting this parameter, the value of Value property will return.
Example:
dim Application = Activator.CreateInstance(Type.GetTypeFromProgID("Reports.E3ApplicationLink")) Application.LinkWithApplication(rpt) Me.Label2.Text = Application.GetViewerValue("", "Caption") Me.Label3.Text = Application.GetViewerValue("Pasta1.TagInterno1")
NOTE: Since Viewer object has no Value property, it’s not possible to use this method with Path parameter as an empty string and omit Property parameter.
2. E3Chart object
To add a Chart object, just click the E3Chart button; thus, you will automatically add a Chart to the report’s Detail section:
You can then resize the Chart, or even drag it to other sections.
In the Organizer, the Chart displays as a Report’s child object, and it can be configured there, via Properties menu:
Likewise, it’s possible to copy an E3Chart from a screen onto the Section Report. This procedure takes place in the Organizer, and then the Query must be copied separately.
3. Printing a copy of E3Chart from screen in a Report
In order to copy an E3Chart from a screen to a Section Report, use CopyConfig(SourceChart) command directly in a script on screen. Example:
Sub CommandButton1_Click() Set Report = Application.LoadReport("RelatorioSecao1") Set Chart = Report.Item("E3Chart1") Set ScreenChart = Screen.Item("E3Chart1") Chart.CopyConfig(ScreenChart) Report.PrintPreview End Sub
This method copies all configurations from one E3Chart to another. SourceChart parameter indicates the source E3Chart, whose properties are copied to the E3Chart that is calling the method. Notice that this method only works with Historic pens.
4. Exporting and importing Reports (RPX file)
It’s possible to export and import a Report’s configurations to an external file. Both Reports and Section Reports can load files in RPX format. However, non-existing or incompatible resources (charts, scripts) in other types of Reports are discarded when loading to a new Report. The object Query can be copied from a Report to a Section Report.
For further information, check the item Section Report from Elipse E3 Reference and Scripts Manual.