Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
ExcelExport problem in file downloading from Tabl1
I am new to Vaadin. at this time i am getting problem in ExcelExport.
when i am click on button it is not downloading file as well as not displaying eny error.
i dont know what is the location of this file. Please checj following code.
final ThemeResource export = new ThemeResource("adminicons/green.png");
final Button excelExportButton = new Button("Export to Excel");
public TestExport() {
final Table table = new Table("This is my Table");
HorizontalLayout vlaLayout = new HorizontalLayout();
table.addContainerProperty("First Name", String.class, null);
table.addContainerProperty("Last Name", String.class, null);
table.addContainerProperty("Year", Integer.class, null);
table.addItem(new Object[] {
"Nicolaus","Copernicus",new Integer(1473)}, new Integer(1));
table.addItem(new Object[] {
"Tycho", "Brahe", new Integer(1546)}, new Integer(2));
table.addItem(new Object[] {
"Giordano","Bruno", new Integer(1548)}, new Integer(3));
table.addItem(new Object[] {
"Galileo", "Galilei", new Integer(1564)}, new Integer(4));
table.addItem(new Object[] {
"Johannes","Kepler", new Integer(1571)}, new Integer(5));
table.addItem(new Object[] {
"Isaac", "Newton", new Integer(1643)}, new Integer(6));
excelExportButton.setIcon(export);
excelExportButton.addListener(new ClickListener() {
private static final long serialVersionUID = -73954695086117200L;
private ExcelExport excelExport;
public void buttonClick(final ClickEvent event) {
excelExport = new ExcelExport(table);
excelExport.excludeCollapsedColumns();
excelExport.setReportTitle("Demo Report");
excelExport.export();
}
});
vlaLayout.addComponent(table);
vlaLayout.addComponent(excelExportButton);
Looking at the sources of ExcelExport, sendConverted() sends the file to the user through application.open(resource). It gets the application reference trough table.getApplication(). That returns the application the table is attached to. My guess is that for some reason it doesn't find the application instance when trying to send it. Do you switch view, remove the table from the view, or something like that, before running the export?
In cases like this it is always good to set a breakpoint in code and start debugging to see exactly what is going wrong.