This preconfiguration can be activated when creating a new object (e.g. by
"New object ..." in the context menu of the object or by pressing the
Insert key after selecting the object).
This preconfiguration is included in the
"/ Reports / Report (PmaReport)" group.
The preconfiguration creates an object of the
PmaReport type. This object is connected in the "
Source file of the report template" configurator to the corresponding template file
RepAlEv.htm. The templates are located in the PROMOTIC system in the
\Promotic\PmVXXYY\Resource\Report folder.
There is a script in the
onReportRequest event.
At the beginning of the script it is necessary to set the valid path to the
PmaAlarmGroup object in the
oAl variable.
The
GetHistoryData method is used for reading the data array:
sColumns (variable) specifies which columns are to be displayed in the report
sFilter1 (variable) specifies that the columns wil have their names localized, up to 200 records will be displayed and last 500 records will be searched.
By the
SetKeyValue the following items are transferred into the template file:
Title1 - report title
Title2 - filtering parameters used and the time-range of the displayed alarm data
nRowsFirst - the number of rows in the table on the first page
nRowsNext - the number of rows in the table on following pages
aData - the corresponding alarm data array
The input filtering parameters can be used for displaying this report. These parameters allow to display only the specific events that are requested. In the script of the
onReportRequest event, the value of this parameter is received as additional filtering formula (
sFilter2) of the
PmaAlarmGroup.GetHistoryData method.
The
source,
desc parameters can be used, either separately or combined.
These configurators can be set before the preconfiguration is created:
The name of created object | Name of the object created in the Pma object tree.
The maximum name length is 30 characters.
This is a system name, so it must contain only alphanumeric and must not contain any diacritics (i.e. national dependent characters), empty string, spaces and first character must not be a number.
Default: "ReportEvHistory" |
Events report title | events report title |
Path to events object | Relative or absolute path to the PmaEventGroup object. |
|
Enable as Web component | Specifies whether this object has to be registered as a Web server component
After the preconfiguration is created, the "PmaPanel > Web server > Enable as Web component" configurator will be set to this value. |
PmaWeb object | Path in the Pma object tree to the object PmaWeb, PmaWebFolder or PmaWebLang where the registration is carried out.
Macro expression can be used for input (it is evaluated after the application is launched).
After the preconfiguration is created, the "PmaPanel > Web server > PmaWeb object" configurator will be set to this value. |
---|
The example of opening the PmaReport object:
Called in the
onButtonUp event of the
PmgButton object. The object will be opened as an separate window.
JavaScriptSelect and copy to clipboard
var oCreator = Pm.CreateView(null, "/ReportEvHistory", "", "target:_blank;");
oCreator.Open();
The example of opening the PmaReport object with parameter:
JavaScriptSelect and copy to clipboard
var oCreator = Pm.CreateView(null, "/ReportEvHistory", "pars:{source:Boil}", "target:main;");
oCreator.Open();
The example of the PmaReport object print:
Called in the
onButtonUp event of the
PmgButton object. 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.
JavaScriptVBScriptSelect and copy to clipboard
var sReport = pMe.Pm("/ReportEvHistory").SaveToString("");
Pm.PrintHtmlPage(sReport, "sourcetype:htmlstring;printer:select;");
Dim sReport
sReport = pMe.Pm("/ReportEvHistory").SaveToString("")
Pm.PrintHtmlPage sReport, "sourcetype:htmlstring;printer:select;"