我尝试将包含超过100,000条记录的vaadin表中的数据导出到CSV 2007文件,因为它支持超过100万行。 我试试这段代码:
CsvExport csvExport = new CsvExport(exporttable,exportedReportName,exportedReportName);
csvExport.excludeCollapsedColumns();
csvExport.setExportFileName(exportedReportName+".csv");
csvExport.setDisplayTotals(false);
csvExport.export();
使用tableexport-for-vaadin-1.5.1.5
和poi-3.10-FINAL.jar
我得到了这个例外;
Caused by: java.lang.IllegalArgumentException: Invalid row number (65536) outside allowable range (0..65535)
at org.apache.poi.hssf.usermodel.HSSFRow.setRowNum(HSSFRow.java:239)
at org.apache.poi.hssf.usermodel.HSSFRow.<init>(HSSFRow.java:87)
at org.apache.poi.hssf.usermodel.HSSFRow.<init>(HSSFRow.java:71)
at org.apache.poi.hssf.usermodel.HSSFSheet.createRow(HSSFSheet.java:232)
at org.apache.poi.hssf.usermodel.HSSFSheet.createRow(HSSFSheet.java:68)
at com.vaadin.addon.tableexport.ExcelExport.addDataRow(ExcelExport.java:518)
at com.vaadin.addon.tableexport.ExcelExport.addDataRows(ExcelExport.java:469)
at com.vaadin.addon.tableexport.ExcelExport.convertTable(ExcelExport.java:264)
at com.vaadin.addon.tableexport.TableExport.export(TableExport.java:80)
at com.mobinets.fm.gui.views.AlarmStatusView$4.buttonClick(AlarmStatusView.java:605)
at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)