Public API Changes in Aspose.Cells 8.9.0

Added APIs

Added HtmlSaveOptions.DefaultFontName Property

Aspose.Cells for Java 8.9.0 has exposed the DefaultFontName property for the HtmlSaveOptions class that allows to specify the default font name while rendering spreadsheets to HTML format. The default font will be used only when the font of style does not exist. The default value of HtmlSaveOptions.DefaultFontName property is null that means, Aspose.Cells for Java API will use the universal font which has the same family with the original font.

Following is the simple usage scenario.

Java

 //Create an instance of HtmlSaveOptions

HtmlSaveOptions options = new HtmlSaveOptions();

//Set default font name for Html rendering

options.setDefaultFontName("Arial");

//Load a spreadsheet in an instance of Workbook

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

//Save the spreadsheet in Html format while passing instance of HtmlSaveOptions

book.save(dir + "output.html", options);

Added ImageOrPrintOptions.DefaultFont Property

Aspose.Cells for Java 8.9.0 allows to set the default font name for the ImageOrPrintOptions class by exposing the DefaultFont property. The said property can be used when Unicode characters in the spreadsheet are not set with correct font in cell style therefore such characters may appear as blocks in the resultant images.

Following is the simple usage scenario.

Java

 //Create an instance of ImageOrPrintOptions

ImageOrPrintOptions options = new ImageOrPrintOptions();

//Set default font name for image rendering

options.setDefaultFont("Arial");

//Load a spreadsheet in an instance of Workbook

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

//Access the worksheet to be rendered

Worksheet sheet = book.getWorksheets().get(0);

//Create an instance of SheetRender

SheetRender render = new SheetRender(sheet, options);

//Save spreadsheet to image

render.toImage(0, dir + "output.png");

Added PivotTable.Excel2003Compatible Property

Aspose.Cells for Java API has exposed the Boolean type Excel2003Compatible property for the PivotTable class which allows to specify if the PivotTable is Excel 2003 compatible for refreshing purposes. The default value of Excel2003Compatible property is true, that means a string must be less than or equal to 255 characters. If the string is greater than 255 characters, it will be truncated. If false, the aforementioned restriction will not be imposed.

Following is the simple usage scenario.

Java

 //Load a spreadsheet in an instance of Workbook

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

//Access the desired Pivot Table from the spreadsheet

PivotTable pivot = book.getWorksheets().get(0).getPivotTables().get(0);

//Set Excel 2003 compatibility to false

pivot.setExcel2003Compatible(false);

//Refresh & recalculate Pivot Table

pivot.refreshData();

pivot.calculateData();