Uso degli Stili Incorporati
Contents
[
Hide
]
Aspose.Cells per Python via .NET fornisce una vasta collezione di stili riutilizzabili per formattare una cella nel documento di fogli di calcolo. Possiamo usare gli stili integrati nel nostro workbook e anche creare stili personalizzati.
Come utilizzare gli stili incorporati
Il metodo Workbook.create_builtin_style e l’enumerazione BuiltinStyleType rendono comodo l’uso degli stili incorporati. Ecco un elenco di tutti gli stili incorporati possibili:
- TWENTY_PERCENT_ACCENT_1
- TWENTY_PERCENT_ACCENT_2
- TWENTY_PERCENT_ACCENT_3
- TWENTY_PERCENT_ACCENT_4
- TWENTY_PERCENT_ACCENT_5
- VENTI_PERC_ACCENTO_6
- QUARANTA_PERC_ACCENTO_1
- QUARANTA_PERC_ACCENTO_2
- QUARANTA_PERC_ACCENTO_3
- QUARANTA_PERC_ACCENTO_4
- QUARANTA_PERC_ACCENTO_5
- QUARANTA_PERC_ACCENTO_6
- SESSANTA_PERC_ACCENTO_1
- SESSANTA_PERC_ACCENTO_2
- SESSANTA_PERC_ACCENTO_3
- SESSANTA_PERC_ACCENTO_4
- SESSANTA_PERC_ACCENTO_5
- SESSANTA_PERC_ACCENTO_6
- ACCENTO_1
- ACCENTO_2
- ACCENTO_3
- ACCENTO_4
- ACCENTO_5
- ACCENTO_6
- CATTIVO
- CALCOLO
- CONTROLLA_CELLA
- VIRGOLA
- VIRGOLA_1
- VALUTA
- VALUTA_1
- TESTO_ESPLICATIVO
- BUONO
- INTESTAZIONE_1
- INTESTAZIONE_2
- INTESTAZIONE_3
- INTESTAZIONE_4
- HYPERLINK
- COLLEGAMENTO_IPERTESTO_SEGUITO
- INPUT
- CELLA_COLLEGATA
- NEUTRO
- NORMALE
- NOTA
- OUTPUT
- PERCENTUALE
- TITOLO
- TOTALE
- TESTO_AVVISO
- LIVELLO_RIGA
- LIVELLO_COLONNA
Codice Python per usare gli stili integrati
This file contains hidden or 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
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) |