Great addon and really happy to use it.
Yet, I’m not a fan that I have to set a key for each column every time.
Maybe you have an example how to make it easer for the user? I mean, leave as much as possible room for mistakes when typing field name for the key.
Also, is there is a way to set Column label for exported file?
Thanks for the feedback, and really glad to hear that this simple addon is helpful. Which version of this exporter are you using?
For Vaadin 8 version, i.e. 2.0.2 onward, you can set up a custom column header as below
ExporterOption exporterOption = new ExporterOption();
exporterOption.getColumnOption("name").columnName("My Name").toUpperCase();
exporterOption.getColumnOption("email").columnName("My Email");
exporterOption.getColumnOption("age").toUpperCase();
StreamResource csvStreamResourceWithCustomHeader = new StreamResource((StreamResource.StreamSource) () -> Exporter.exportAsCSV(grid, exporterOption), "my-csv-with-custom-header.csv");
FileDownloader csvFileDownloaderWithCustomHeader = new FileDownloader(csvStreamResourceWithCustomHeader);
csvFileDownloaderWithCustomHeader.extend(downloadAsCSVWithCustomHeader);
It’s not available in the Experter 3.x.x yet, I will make it available there soon
I’m using 3.0.1 with Vaadin 14.
Is upcoming changes will be similar to what you demonstrated above? We will have to use additional configuration object?
Isn’t there a way just take current header of the table? Just curious.