The WorkWith and SubWorkWith nodes in K2BEntityServices Pattern, as well as the Web Panel Designer Grid node, can generate spreadsheets reports based on the grid's columns. These Excel reports are created using the ExcelDocument data type
To enable spreadsheet generation in a K2BEntityServices instance, set the "Export enabled" property to true in the standard actions node within the WorkWith and SubWorkWith nodes.
 |
| ExportEnabledProperty |
By default, this property is set to true. You can modify this behavior in K2BEntityServices settings under Standard Actions -> Export to Excel -> Enable by default property.
 |
| Default value of export enabled |
The default procedure name for implementing the report is <ObjectName>Export. This naming convention can be changed in K2BEntityServicesSettings under GeneratedObjectNames -> Export.
To enable spreadsheet generation in the Web Panel Designer, set the "Export to Spreadsheet enabled" property, located in the Grid node to true.
 |
| Export to Spreadsheet in WebPanelDesigner |
The default value of this property is false. The default procedure name for implementing the report is Export<ObjectName><GridName>, which can be changed in the "Generated Export Name" property located in the Grid node.
The Export to Spreadsheet feature is supported in:
The columns included in the export are those related to attributes or variables with the "Use In Spreadsheet export" set to true.
 |
| Use column in spreadsheet report |
It also considers the runtime column selection in grids; by default, only visible columns selected by the user are included in the report. This behavior can be changed using the "Use Grid Column Configuration" property located in K2BEntityServices settings under Standard Actions -> Export To Excel -> Use Grid Column Configuration.
 |
| Use Grid Column Configuration |
In K2BEntityServices settings under Standard Actions -> Export To Excel, you can configure the start row and start column of the report. Additionally, the ShowContextHeader property can be set to false to remove title and filter information included in the Excel report.
All export reports are based on a layout that can be used for further customization. For more information about this feature, read Export Layout.
In GeneXus, for the ExcelDocument to be shown to the user, it needs to be temporarily stored on the server. The ExcelFileType property is available in K2BEntityServices settings under Standard Actions -> ExportToExcel. By default, ExcelDocuments are temporarily stored in Directory.TemporaryFilesPath. The ExcelDocument is returned in an HttpResponse, managed by the K2BT_ReturnFileInHttpResponse procedure, and the file is removed after 10 seconds. To change this behavior, the K2BRemoveExcelDocument procedure can be customized.
|