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 context menu of the object or by pressing the
Insert key after selecting the object).
This preconfiguration is included in the
"/ Reports / Report to an Excel file" group.
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 the
JSON format in the
"data" method to the
data sheet of the Excel to the position "A1". Finally, it saves this file into the "
download" folder set in the client's Web browser.
Warning:
For the widget to work properly in the local application, it is necessary to have WebView2 (Edge) installed in 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 preconfiguration requires support for Microsoft Edge WebView2 Runtime.
And in the application's INI file it is necessary to enter the WebView2=1 key into the [Promotic] section. | |
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: 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");