2015-01-02 59 views
1

在我的表我有一列定義如下:Vaadin TABLEEXPORT插件不處理標籤組件直接

table.addContainerProperty("Skill", Label.class, null); 

當我使用TableExport插件

Button excelExportButton = new Button("Export to Excel", click -> { 
     ExcelExport excelExport; 
     excelExport = new ExcelExport(table); 
     excelExport.setReportTitle("Foo Bar"); 
     excelExport.setDisplayTotals(false); 
     excelExport.export(); 
    }); 

導出這個表,我得到[email protected]代替文本。我怎樣才能解決這個問題?

非常感謝您的幫助。

回答

2

我從來沒有使用過的TABLEEXPORT插件,但我在我的腦海兩種解決方案:

  1. 使用String的屬性類型:table.addContainerProperty("Skill", String.class, null);

  2. 創建您自己的擴展Label和覆蓋toString()方法返回想要在導出的Excel表單中看到的值。

+0

我不能接受第一個提議,但第二個提議。謝謝! –