Public API Changes in Aspose.Cells 8.3.0

Added APIs

Added WorkbookSettings.AutoRecover Property

The getter/setter for the property AutoRecover have been added to the WorkbookSettings class in order to allow developers to get/set option of Auto-Recovery for the spreadsheets in their applications.

Java

 Workbook book = new Workbook("sample.xlsx");

WorkbookSettings settings = book.getSettings();

settings.setAutoRecover(true);

Added WorkbookSettings.CrashSave Property

The getter/setter for the property CrashSave have been added to the WorkbookSettings class. The Boolean type property indicates whether the application last saved the workbook file after a crash.

Java

 Workbook book = new Workbook("sample.xlsx");

WorkbookSettings settings = book.getSettings();

System.out.println(settings.getCrashSave());

Added WorkbookSettings.DataExtractLoad Property

The getter/setter for the property DataExtractLoad have been added to the WorkbookSettings class in order to allow the developers to get/set the information regarding the last recovery. If the property DataExtractLoad returns true that indicates that the data recovery has been performed on the workbook file.

Java

 Workbook book = new Workbook("sample.xlsx");

WorkbookSettings settings = book.getSettings();

System.out.println(settings.getDataExtractLoad());

Added WorkbookSettings.RepairLoad Property

The getter/setter for the property RepairLoad have been added to the WorkbookSettings class. The Boolean type property indicates if the spreadsheet has been repaired in the last loading session with Excel application.

Java

 Workbook book = new Workbook("sample.xlsx");

WorkbookSettings settings = book.getSettings();

System.out.println(settings.getRepairLoad());

Added TxtLoadOptions.KeepExactFormat Property

The property KeepExactFormat has been added to the TxtLoadOptions class that indicates whether the exact formatting should be kept for the cell value when string/text is converted to numbers or DateTime. This property has been added to match the behavior of MS Excel application for loading DateTime or numeric values from CSV files. In order to simulate the MS Excel’s behavior, set the KeepExactFormat property to false, whereas the default value is true so the cell value will be formatted as the string in CSV file.

Java

 TxtLoadOptions options = new TxtLoadOptions();

options.setKeepExactFormat(false);

Workbook book = new Workbook("sample.csv", options);

Added Shape.Id Property

The v8.3.0 has added the getter/setter for the property Shape.Id in order to uniquely identify each shape object in a given spreadsheet. This new property also helps in uniquely identifying Chart objects in a spreadsheet as demonstrated below.

Java

 Workbook book = new Workbook("sample.xlsx");

ChartCollection charts = book.getWorksheets().get(0).getCharts();

for(int index = 0; index <= charts.getCount(); index++)

{

    Chart chart = charts.get(index);

    Shape shape = (Shape)chart.getChartObject();

    System.out.println(shape.getId());

}

Added PlotArea.setPositionAuto Method

The method setPositionAuto has been added to the PlotArea class that helps in setting the chart’s plot area to automatic mode.

Java

 Workbook book = new Workbook("sample.xlsx");

Chart chart = book.getWorksheets().get(0).getCharts().get(0);

chart.getPlotArea().setPositionAuto();