BuiltinStyleType in Java

Hi all


Is there an example in Java how I can add a BuiltinStyleType to a cell.

Thanks in advance.
Simon

Hi Simon,


You may create & apply the built in style’s using the following piece of code. However, please note that the StyleCollection class (accessed via Workbook.getStyles) has been marked obsoleted with recent releases of the API so I have logged a ticket CELLSJAVA-41581 for the product team to provide an alternative approach. We will keep you posted with updates in this regard.

Java

Workbook book = new Workbook();
Style builtInStyle = book.getStyles().createBuiltinStyle(BuiltinStyleType.TITLE);
Cell cell = book.getWorksheets().get(0).getCells().get(“A1”);
cell.putValue(“Some Text”);
cell.setStyle(builtInStyle);
book.save(“C:/temp/output.xlsx”);

Thank you for your code snippet and creating a ticket.

Hi,

Thanks for using Aspose.Cells.

It is to inform you that we have fixed your issue CELLSJAVA-41581 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for using Aspose.Cells.

Please try the method: Workbook.CreateBuiltinStyle(BuiltinStyleType)

Please download and try the latest fix: Aspose.Cells for Java v8.6.2.6 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-41581) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.