Preconfiguration "PmaWebDir - Creating an Excel file (*.xlsx) from a sample file and adding 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:
"/ Report / Report to an Excel file".
The preconfiguration creates a configured
PmaWebDir object in the
PmaWeb object and inserts the widget files "xlsx.full.min.js" and "Template.xlsx" 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 and uses the
"xlsx.full.min.js" widget (
https://sheetjs.com/) to load the excel file
"Template.xlsx". It then transfers the data that is prepared in
JSON format in the
data method into the
data sheet of the excel to the position
"A1". Finally, it saves this file to the download folder set in the Web browser of the client.
Warning:
For the widget to work properly in a 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)
The widget does not support loading a file containing charts.
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 files "xlsx.full.min.js" and "Template.xlsx" into the Resource folder. The widget does not support loading a file containing charts. | |
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.
Default: SheetJs |
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");