Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Preconfigurations PmReport - Events history

This preconfiguration can be activated when creating a new object (e.g. by "New object" in the local object menu or by pressing the Insert key after selecting the object) and is included in the group: " / Report (PmReport)".
 
Preconfiguration creates an object of type PmReport. It is connected by the Source file of the report template configurator to the corresponding RepAlEv.htm. The templates are located in the PROMOTIC system in the Resource\Report folder.
 
There is a script in the onReportRequest event.

At the beginning of the script it is necessary to define the valid path to the PmAlarmEvent object in the oAl variable.

The GetHistoryData method is used for reading the data array:

sColumns (variable) defines which columns are to be displayed in the protocol
sFilter1 (variable) defines that the columns wil have their titles localized, up to 200 records will be displayed and last 500 recods will be searched.

By the SetKeyValue the following items are transfered into the template file :

Title1 - report title
Title2 - filtering parameters used and the timespan of the displayed alarm data
nRowsFirst - the number of rows of the table on the first page
nRowsNext - the number of rows of the table on following pages
aData - the corresponding alarm data array
 
The input fitering parameters can be used for displaying this report. These will allow to display only the specific alarms that are requested. In the script of the onReportRequest event, the value of this parameter is received as additional filtering formula (sFilter2) of the PmAlarmEvent.GetHistoryData method.

It is possible to use the source, desc parameters, either separately or combined.

These configurators can be set before the preconfiguration is created:
The name of created objectName of the object created in the application object tree. This is a system name and must not contain empty string, diacritics, spaces and the first character must not be a number.

Default: "ReportEvHistory"

Events protocol titleevents protocol title
Path to events objectRelative or absolute path to PmAlarmEvent object.
An example of opening the PmReport object without a parameter:
Called in the onButtonUp event of the PmiButton graphic item. The object will be opened as an independent window.
pMe.PmPanel.OpenView "/ReportEvHistory", "target:_blank;"
An example of opening the PmReport object with a parameter:
Called in the onButtonUp event of the PmiButton graphic item. The object will be open in a frame "main" in the PmWorkspace object and with a value of the source parameter defined in the sParams default value configurator changed to Boil.
pMe.PmPanel.OpenView "/ReportEvHistory", "target:main;", "par:source=Boil;"
An example of the PmReport object print:
Called in the onButtonUp event of the PmiButton graphic item. The example is functional only in the local application. If the print is to be functional also in the web client, then the SaveToString method must be called in the panel method on the server.
Dim sReport
sReport = pMe.Pm("/ReportEvHistory").SaveToString("")
Pm.PrintHtmlPage sReport, "sourcetype:htmlstring;printer:select;"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice