Directory

← Back

Grid Exporter Add-on

Extension for exporting Vaadin's grid data to common formats

Author

Rating

Popularity

1700+

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);

Compatibility

(Loading compatibility data...)

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

Initial Vaadin Directory Release. More info: https://github.com/FlowingCode/GridExporterAddon/releases

Released
2022-08-18
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 23
Vaadin 24.3 in 2.3.2
Vaadin 24 in 2.2.1
Browser
Browser Independent

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online