Document Opening very slow

Hi,


I am using aspose cell 7.5 version and doing as followig to remove drawing(charts n Images) from worksheets

workbook.getWorksheets().get(sheetIndex).removeAllDrawingObjects()

Please suggest if this is correct way of doing so. All I want is to just remove the charts n images out of the file and get a new file with content only.

Also, the attached file is taking too much time to open/load in memory , please suggest any solution to this.

If i execute following code on attached file, i am also getting exception
Workbook workbook=new Workbook(inputFilePath);
for(int sheetIndex=0;sheetIndex<workbook.getWorksheets().getCount();sheetIndex++){
workbook.getWorksheets().get(sheetIndex).removeAllDrawingObjects();
System.out.println(“Sheet Done:-”+sheetIndex);
}
workbook.save(outputFilePath);

==========================

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at com.aspose.cells.FileFormatUtil.extensionToSaveFormat(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.intralinks.odfprocessingTest.ODSWorkBook.saveAsContentOnly(ODSWorkBook.java:315)
at com.intralinks.odfprocessingTest.ODSWorkBook.main(ODSWorkBook.java:83)

Thanks,


The exception is resolved on my end now, i was not providing extension in the output file name

Please suggest, if I can use LoadOption.setLoadDataOnly property to true? and will have all the formatting info for rows,cols and cells as it is?
Because, i guess if i dont need the charts and images, i should look for some way to load the file without that altogether?


Hi,


Yes, surely it will work for you and may take very less time if you only need data and want to eliminate drawing shapes and charts etc.
e.g

Sample code:

LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadDataOnly(true);
Workbook workbook=new Workbook(“39MB+xlsx+39sheets_20Graphs_1710rows.xlsx”, loadOptions);

workbook.save(“out39MB+xlsx+39sheets_20Graphs_1710rows.xlsx”);

And, could you spare us a little time (may be 2-3 days) to evaluate your issue on why it is taking much time to process your file and code. Hopefully, we could figure it out soon.

Thank you.

Sure, I will do profiling on the file, and will share the results if i found something noticable


Thanks,

Hi,

For your issue about performance, please try our latest fix/version (v7.5.0.5). We have improved the performance for reading such kind of template files in it.

Thank you.