Público API Cambios en Aspose.Cells 8.9.0

API añadidas

Se agregó la propiedad HtmlSaveOptions.DefaultFontName

Aspose.Cells for Java 8.9.0 ha expuesto la propiedad DefaultFontName para la clase HtmlSaveOptions que permite especificar el nombre de fuente predeterminado al representar hojas de cálculo en formato HTML. La fuente predeterminada se utilizará solo cuando la fuente de estilo no exista. El valor predeterminado de la propiedad HtmlSaveOptions.DefaultFontName es nulo, lo que significa que Aspose.Cells for Java API utilizará la fuente universal que tiene la misma familia que la fuente original.

El siguiente es el escenario de uso simple.

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);

Se agregó la propiedad ImageOrPrintOptions.DefaultFont

Aspose.Cells for Java 8.9.0 permite establecer el nombre de fuente predeterminado para la clase ImageOrPrintOptions al exponer la propiedad DefaultFont. Dicha propiedad se puede usar cuando los caracteres Unicode en la hoja de cálculo no están configurados con la fuente correcta en el estilo de celda, por lo tanto, dichos caracteres pueden aparecer como bloques en las imágenes resultantes.

El siguiente es el escenario de uso simple.

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");

Se agregó la propiedad PivotTable.Excel2003Compatible

Aspose.Cells for Java API ha expuesto la propiedad Excel2003Compatible de tipo booleano para la clase de tabla dinámica que permite especificar si la tabla dinámica es compatible con Excel 2003 para fines de actualización. El valor predeterminado de la propiedad Excel2003Compatible es verdadero, lo que significa que una cadena debe tener 255 caracteres o menos. Si la cadena tiene más de 255 caracteres, se truncará. En caso de ser falsa, no se impondrá la restricción antes mencionada.

El siguiente es el escenario de uso simple.

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();