Promotic

Preconfiguration "PmaWebDir - Creating an Excel file (*.xlsx) with data (without MS Excel)"

This preconfiguration can be activated when creating a new object (e.g. by "New object ..." in the local object menu or after pressing the Insert key after selecting the object) and is included in the group: "/ Report / Report to an Excel file".

The preconfiguration creates a configured PmaWebDir object in the PmaWeb object and inserts the widget file "xlsx.full.min.js" into the Resource folder.

PmaWebDir object description
The newly created object in the PmaWebDir.onPageModify event catches the request to open the html page widget.htm sent by the CreateFile method with the sFile and sDataType parameters. It passes this to the widget method, which creates the page using the "xlsx.full.min.js" widget (https://sheetjs.com/)) and creates a new excel file. It will then transfer the data that is prepared in JSON format in the data method to the data sheet of the excel to the position "A1". Finally, it saves this file to the download folder set in the client's web browser.
Warning:
For the widget to work properly in a local application, it is necessary to have WewbView2 (Edge) installed on the Windows OS.
The component is called Microsoft Edge WebView2 Runtime version Evergreen.
Its use must be enabled in the application's "ini" file.
See Web browser (/#glob/webbrowser)
These configurators can be set before the preconfiguration is created:
The preconfiguration creates a configured PmaWebDir object in the PmaWeb object and inserts the widget file "xlsx.full.min.js" into the Resource folder.
The name of created objectName of the object created in the tree of Pma objects. The maximum name length is 30 characters. This is a system name, so it must contain only alphanumeric and must not contain any diacritics, empty string, spaces and the first character must not be a number.
Default: SheetJsNew
Path to the PmaWeb object
Example of calling a method that generates a report to Excel:
JavaScriptSelect and copy to clipboard

pMe.Pm("/Web/CreateExcelFile").Methods.CreateFile("Boiler1.xlsx", "Boiler1");

History:
Pm9.00.23: Created
PROMOTIC 9.0.23 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.