Utilizando Estilos Incorporados
Contents
[
Hide
]
Aspose.Cells proporciona una vasta colección de estilos reutilizables para formatear una celda en un documento de hoja de cálculo. Podemos usar estilos incorporados en nuestro libro de trabajo y también crear estilos personalizados.
Cómo utilizar Estilos Incorporados
El método Workbook.CreateBuiltinStyle 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 C# para usar estilos integrados
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
string output1Path = dataDir + "Output.xlsx"; | |
string output2Path = dataDir + "Output.out.ods"; | |
Workbook workbook = new Workbook(); | |
Style style = workbook.CreateBuiltinStyle(BuiltinStyleType.Title); | |
Cell cell = workbook.Worksheets[0].Cells["A1"]; | |
cell.PutValue("Aspose"); | |
cell.SetStyle(style); | |
Worksheet worksheet = workbook.Worksheets[0]; | |
worksheet.AutoFitColumn(0); | |
worksheet.AutoFitRow(0); | |
workbook.Save(output1Path); | |
Console.WriteLine("File saved {0}", output1Path); | |
workbook.Save(output2Path); | |
Console.WriteLine("File saved {0}", output1Path); |