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 by pressing the Insert
key after selecting the object) and is included in the group: "/ Reports / 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
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
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.
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 ini file of the application 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 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 (i.e. national dependent chars), empty string, spaces and the first character must not be a number.
|Path to the PmaWeb object|
Example of calling a method that generates a report to Excel: