2
4

1 回答 1

7

我也面临这个问题。对我来说,解决方案非常简单。我只需要将我的 WorkbookSettings 放在 TEMPLATE wb 中,而不是放在新文件中。

//Load template workbook with settings
WorkbookSettings ws = new WorkbookSettings();
ws.setEncoding("Cp1252");

Workbook templateWorkbook = Workbook.getWorkbook(this.context.getAssets().open("template.xls"), ws);

//Create new workbook from templateWorkbook without settings
this.workbook = Workbook.createWorkbook(new File(this.location), templateWorkbook);

发现于:Android 和 JXL:创建 WritableWorkbook 时的 ArrayIndexOutOfBoundException

问候

于 2014-01-15T13:36:31.123 回答