Hi there,I'm trying to create a java program that reads an XLS (excel) file andperforms some modifications. The issue here is, the final version ofthe workbook needs to have pivot tables and when i save the new fileit saves without the pivot tables. Is there a way to overcome thisissue? I'll paste de necessary code do view this issue. Thanks inadvance for any help.option 1 (trying to write directly to the xls file without performinga copy)class Main{ public static void main(String[] args) { try{ WritableWorkbook copy = Workbook.createWorkbook(newFile("SalesByOperador1.xls")); WritableSheet sheet2 = copy.getSheet(0); // error while gettingindex ArrayOutOfBounds, file already exists and is the final version. Label label = new Label(7, 0, "New label record"); sheet2.addCell(label); copy.write(); copy.close();option 2 (doesn't store the pivot tables on output.xls)class Main{ public static void main(String[] args) { try{ Workbook workbook = Workbook.getWorkbook(newFile("SalesByOperador1.xls")); WritableWorkbook copy = Workbook.createWorkbook(newFile("output.xls"), workbook); WritableSheet sheet2 = copy.getSheet(0); //WritableCell cell = sheet2.getWritableCell(1, 2); Label label = new Label(7, 0, "New label record"); sheet2.addCell(label); copy.write(); copy.close();
|
|
-1
|
|
|
|
Reply
|
kubic62 (34)
|
7/20/2007 10:10:17 AM |
|