Grid Exporter Add-on
Extension for exporting Vaadin's grid data to common formats
This is an addon that allows to export Vaadin's grid data to some formats like Excel, Docx, PDF and CSV.
Features:
- Can configure which columns to export
- Other templates can be used besides the basic templates
- Optionally can create the export buttons automatically (default)
Sample code
GridExporter<Person> exporter = GridExporter.createFor(grid); exporter.setExportValue(c, item->""+item.getBudget()); exporter.setTitle("People information"); exporter.setFileName("GridExport" + new SimpleDateFormat("yyyyddMM").format(Calendar.getInstance().getTime())); add(grid);
GridExporter<Person> exporter = GridExporter.createFor(grid, "/custom-template.xlsx", "/custom-template.docx"); HashMap<String,String> placeholders = new HashMap<>(); placeholders.put("${date}", new SimpleDateFormat().format(Calendar.getInstance().getTime())); exporter.setExportColumn(nameColumn, false); exporter.setExportColumn(lastNameColumn, true); exporter.setAdditionalPlaceHolders(placeholders); exporter.setSheetNumber(1); exporter.setCsvExportEnabled(false); exporter.setTitle("People information"); exporter.setFileName("GridExport" + new SimpleDateFormat("yyyyddMM").format(Calendar.getInstance().getTime())); add(grid);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
New features:
- Implement concurrent export limit (#117)
- Disable button while file is being downloaded (#126)
- Support cancelling queued downloads if the UI is closed (#127)
Bug fixes:
- Released
- 2024-09-17
- Maturity
- TESTED
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 24.4
- Vaadin 24 in 2.0.0
- Vaadin 23 in 1.0.1
- Vaadin 24.3 in 2.3.0
- Browser
- N/A
Grid Exporter Add-on - Vaadin Add-on Directory
Extension for exporting Vaadin's grid data to common formatsOnline Demo
Issue tracker
View on GitHub
Grid Exporter Add-on version 1.0.1
Initial Vaadin Directory Release. More info: https://github.com/FlowingCode/GridExporterAddon/releases
Grid Exporter Add-on version 1.1.0
### Bugfixes & Enhancements
* Add support for custom null value handler ([#9](https://github.com/FlowingCode/GridExporterAddon/issues/9))
* Add proper handling of missing optional placeholders ([#3](https://github.com/FlowingCode/GridExporterAddon/issues/3) and [#4](https://github.com/FlowingCode/GridExporterAddon/issues/4))
* Add support for BasicRenderers such as LocalDateRenderer ([#11](https://github.com/FlowingCode/GridExporterAddon/issues/11))
* Add support for auto width in excel columns ([#12](https://github.com/FlowingCode/GridExporterAddon/issues/12))
Grid Exporter Add-on version 1.2.0
#### New features:
* Add the possibility to align the export buttons to the left ([#18](https://github.com/FlowingCode/GridExporterAddon/issues/18))
Grid Exporter Add-on version 1.2.1
### Bugfixes:
* Fix NPE when the grid to export does not contain a footer row (Fixes [#20](https://github.com/FlowingCode/GridExporterAddon/issues/20))
Grid Exporter Add-on version 1.3.0
### New Features
* Implement cell alignment based on grid's column text alignment
* Excel native datatype for numbers and dates support
### Bugfixes
* Fixed issue when exporting to PDF or Docx: the first row was exported correctly, but from the second onwards all rows were sorted in descending order ([#28](https://github.com/FlowingCode/GridExporterAddon/issues/28))
Grid Exporter Add-on version 1.4.0
#### New features:
* upgrade font-awesome-iron-iconset to version 4.2.0 ([#37](https://github.com/FlowingCode/GridExporterAddon/issues/37))
* update poi to version 5.2.3
* docs: clarify that the exporter has to be created before attaching the grid ([#8](https://github.com/FlowingCode/GridExporterAddon/issues/8))
* add support for component based headers ([#33](https://github.com/FlowingCode/GridExporterAddon/issues/33))
* upgrade error-window-vaadin to version 3.4.0
* upgrade grid-helpers to version 0.3.3
Grid Exporter Add-on version 1.4.1
#### Bug fixes:
* check if grid has footer on csv export ([#46](https://github.com/FlowingCode/GridExporterAddon/issues/46))
* extract Grid data in main thread to avoid UI locking issues ([#45](https://github.com/FlowingCode/GridExporterAddon/issues/45))
Grid Exporter Add-on version 1.5.0
#### New features:
* Allow setting columns position in exported file ([#52](https://github.com/FlowingCode/GridExporterAddon/issues/52))
#### Bug fixes:
* Fix ClassCastException when exporting ([#54](https://github.com/FlowingCode/GridExporterAddon/issues/54))
Grid Exporter Add-on version 1.6.0
#### Bug fixes:
* upgrade grid-helpers to 1.1.1 ([#67](https://github.com/FlowingCode/GridExporterAddon/issues/67))
* remove use of reflection
* add missing parameter to query ([#70](https://github.com/FlowingCode/GridExporterAddon/issues/70))
Grid Exporter Add-on version 2.0.0
#### Bug fixes:
* use Vaadin 24 API ([#51](https://github.com/FlowingCode/GridExporterAddon/issues/51))
* upgrade grid-helpers to 1.1.1 ([#67](https://github.com/FlowingCode/GridExporterAddon/issues/67))
* remove use of reflection
* add missing parameter to query ([#70](https://github.com/FlowingCode/GridExporterAddon/issues/70))
Grid Exporter Add-on version 1.7.0
#### Bug fixes:
* Set a default value for excelFormat if it's null ([#73](https://github.com/FlowingCode/GridExporterAddon/issues/73))
* Allow setExportValue to supply other types not just Strings ([#74](https://github.com/FlowingCode/GridExporterAddon/issues/74))
Grid Exporter Add-on version 2.1.0
#### New features:
* support hierarchical dataprovider
* apply conditional formatting in excel export
* allow setExportValue to supply other types not just Strings ([#74](https://github.com/FlowingCode/GridExporterAddon/issues/74))
#### Bug fixes:
* set a default value for excelFormat if it's null ([#73](https://github.com/FlowingCode/GridExporterAddon/issues/73))
Grid Exporter Add-on version 1.8.0
#### New features:
* Support hierarchical dataprovider
* Apply conditional formatting in excel export
Grid Exporter Add-on version 2.1.1
#### Bug fixes:
* Fix bad performance issue on huge grids ([#82](https://github.com/FlowingCode/GridExporterAddon/issues/82))
Grid Exporter Add-on version 2.2.0
#### Bug fixes:
* Fix missing last row when exporting Excel file ([#85](https://github.com/FlowingCode/GridExporterAddon/issues/85))
#### New features:
* Add support to add components to footer toolbar ([#81](https://github.com/FlowingCode/GridExporterAddon/issues/81))
Grid Exporter Add-on version 2.2.1
#### Bug fixes:
- Fix to reuse cell style ([#87](https://github.com/FlowingCode/GridExporterAddon/issues/87))
Grid Exporter Add-on version 1.8.1
#### Bug fixes:
* Fix bad performance issue on huge grids ([#82](https://github.com/FlowingCode/GridExporterAddon/issues/82))
* Fix missing last row when exporting Excel file ([#85](https://github.com/FlowingCode/GridExporterAddon/issues/85))
Grid Exporter Add-on version 1.9.0
#### Bug fixes:
* fix: reuse cell style ([#87](https://github.com/FlowingCode/GridExporterAddon/issues/87))
* fix: clear column cellstyle info before starting the export([#100](https://github.com/FlowingCode/GridExporterAddon/issues/100))
#### New features:
* feat: add support for providing excel formats per cell([#93](https://github.com/FlowingCode/GridExporterAddon/issues/93))
Grid Exporter Add-on version 2.3.0
#### Bug fixes:
* fix: clear column cellstyle info before starting the export([#100](https://github.com/FlowingCode/GridExporterAddon/issues/100))
#### New features:
* feat: add UTF-8 with BOM support for CSV exported files ([#89](https://github.com/FlowingCode/GridExporterAddon/issues/89))
* feat: add support for providing excel formats per cell([#93](https://github.com/FlowingCode/GridExporterAddon/issues/93))
Grid Exporter Add-on version 1.9.1
#### Bug fixes:
* Fix inconsistent styling of footer cell ([#105](https://github.com/FlowingCode/GridExporterAddon/issues/105))
Grid Exporter Add-on version 2.3.1
#### Bug fixes:
* Fix inconsistent styling of footer cell ([#105](https://github.com/FlowingCode/GridExporterAddon/issues/105))
Grid Exporter Add-on version 2.3.2
#### Bug fixes:
* Upgrade font-awesome to 5.2.2 ([#104](https://github.com/FlowingCode/GridExporterAddon/issues/104))
Grid Exporter Add-on version 2.4.0
#### New features:
* Implement concurrent export limit ([#117](https://github.com/FlowingCode/GridExporterAddon/issues/117))
* Disable button while file is being downloaded ([#126](https://github.com/FlowingCode/GridExporterAddon/issues/126))
* Support cancelling queued downloads if the UI is closed ([#127](https://github.com/FlowingCode/GridExporterAddon/issues/127))
#### Bug fixes:
* Use StreamResourceWriter instead of InputStreamFactory
* Simplify exception handling ([#123](https://github.com/FlowingCode/GridExporterAddon/issues/123))
* Fix problem when exporting grids with only one column ([#124](https://github.com/FlowingCode/GridExporterAddon/issues/124))