Vaadin 8 Grid Export to excel file

Hi ,

I Am using 8.0.1 version
and Initiating vaadin Grid as follows

Grid grid = new Grid<>();
grid.setWidth(“100%”);
grid.setColumnReorderingAllowed(true);
grid.setSelectionMode(SelectionMode.SINGLE);

grid.addColumn(PersonData::getId).setCaption(“ID”);
grid.addColumn(PersonData::getName).setCaption(“Name”);
grid.addColumn(PersonData::getWeight).setCaption(“Weight”);

how can i achive the export functionality . With column names as (ID,Name,Weight) in excel file

Thanks
Nagaraj RC

Can anyone please help me on this .
Atleast how can i iterate throw all rows of the Grid with its column heading.

Thanks
Nagaraj RC

(I’m new to Vaadin also so I’m guessing)

Have you tried some add-on? Or using Apache POI or jexcelapi it should be pretty easy to iterate over the columns (or the source data itself) and generate and Excel

I tryied by using Apache POI and i have list of data ready for writting to excel.
This makes my list of data to excel.
My problem is i need to provide excel column headings should be as Grid column headings and number of columns also be same.

Thanks
Nagaraj RC

Do you need some information that can’t be found from grid.getColumns()?