Utilizando Estilos Incorporados

Cómo utilizar Estilos Incorporados

El método Workbook.create_builtin_style y la enumeración BuiltinStyleType hacen conveniente el uso de estilos incorporados. Aquí hay una lista de todos los posibles estilos incorporados:

  • TWENTY_PERCENT_ACCENT_1
  • TWENTY_PERCENT_ACCENT_2
  • TWENTY_PERCENT_ACCENT_3
  • TWENTY_PERCENT_ACCENT_4
  • TWENTY_PERCENT_ACCENT_5
  • VEINTE_PORCIENTO_ACENTO_6
  • CUARENTA_PORCIENTO_ACENTO_1
  • CUARENTA_PORCIENTO_ACENTO_2
  • CUARENTA_PORCIENTO_ACENTO_3
  • CUARENTA_PORCIENTO_ACENTO_4
  • CUARENTA_PORCIENTO_ACENTO_5
  • CUARENTA_PORCIENTO_ACENTO_6
  • SESENTA_PORCIENTO_ACENTO_1
  • SESENTA_PORCIENTO_ACENTO_2
  • SESENTA_PORCIENTO_ACENTO_3
  • SESENTA_PORCIENTO_ACENTO_4
  • SESENTA_PORCIENTO_ACENTO_5
  • SESENTA_PORCIENTO_ACENTO_6
  • ACENTO_1
  • ACENTO_2
  • ACENTO_3
  • ACENTO_4
  • ACENTO_5
  • ACENTO_6
  • MAL
  • CÁLCULO
  • VERIFICAR_CELDA
  • COMA
  • COMA_1
  • MONEDA
  • MONEDA_1
  • TEXTO_EXPLICATIVO
  • BUENO
  • ENCABEZADO_1
  • ENCABEZADO_2
  • ENCABEZADO_3
  • ENCABEZADO_4
  • HYPERLINK
  • HIPERVÍNCULO_SEGUIDO
  • ENTRADA
  • CELDA_VINCULADA
  • NEUTRAL
  • NORMAL
  • NOTA
  • SALIDA
  • PORCENTAJE
  • TÍTULO
  • TOTAL
  • TEXTO DE ADVERTENCIA
  • NIVEL DE FILA
  • NIVEL DE COLUMNA

Código Python para usar estilos incorporados

from aspose.cells import BuiltinStyleType, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
output1Path = dataDir + "Output.xlsx"
output2Path = dataDir + "Output.out.ods"
workbook = Workbook()
style = workbook.create_builtin_style(BuiltinStyleType.TITLE)
cell = workbook.worksheets[0].cells.get("A1")
cell.put_value("Aspose")
cell.set_style(style)
worksheet = workbook.worksheets[0]
worksheet.auto_fit_column(0)
worksheet.auto_fit_row(0)
workbook.save(output1Path)
print("File saved {0}", output1Path)
workbook.save(output2Path)
print("File saved {0}", output1Path)