Yerleşik Stilleri Kullanma

Yerleşik Stiller nasıl kullanılır?

yöntemWorkbook.createBuiltinStyle ve sınıfYerleşik Stil Türüyeniden kullanılabilir stiller oluşturmayı kolaylaştırır. İşte olası tüm yerleşik stillerin bir listesi:

Aşağıdaki kod, yerleşik stillerin nasıl kullanılacağını gösterir.

yapılacaklar:resim_alternatif_metin

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
String dataDir = Utils.getDataDir(UsingBuiltinStyles.class);
String output1Path = dataDir + "Output.xlsx";
String output2Path = dataDir + "Output.ods";
Workbook workbook = new Workbook();
Style style = workbook.createBuiltinStyle(BuiltinStyleType.TITLE);
Cell cell = workbook.getWorksheets().get(0).getCells().get("A1");
cell.putValue("Aspose");
cell.setStyle(style);
workbook.getWorksheets().get(0).autoFitColumn(0);
workbook.getWorksheets().get(0).autoFitRow(0);
workbook.save(output1Path);
System.out.println("File saved " + output1Path);
workbook.save(output2Path);
System.out.println("File saved " + output2Path);