How to export a view to excel with POI4XPAGES
After you created an Excel Template, added it as dataSource and configured the export properties we now going to export a view.
Our export view looks like this. Keep the column titles in mind, as we are going to use them for the column definition for our export:
To export a view a exportDefinition has to be added:
We can choose between data2rowexport and data2columnexport which represents the export direction.
· startRow: 0 based. Defines the row where the export should start Assign the dataSource:
· stepSize: 1 or higher. It’s possible to export a dataset to 1, 2 or more rows. (see columns for how to assign an other row)
· database: define the database which has to be used, empty means the current databaseAssign the columns:
Each column needs a columnDefinition.
· key: works like getAllDocumentsByKey
· maxRow: the maximum (currently 1’500 entries) of entries to export
· search: a fulltext search query
· viewName: the name of the view to export
· columnNumber: the number of the column (0 based)
The export works with the same button we created for the Configuration export.
· columnTitle: the title of the column from the view defined as dataSource
· rowShift: this defines how many rows down the value should be shifted (multiple row export per dataset)