Uso degli Stili Incorporati
Contents
[
Hide
]
Aspose.Cells fornisce una vasta raccolta di stili riutilizzabili per formattare una cella nel documento di foglio di calcolo. Possiamo utilizzare gli stili incorporati nel nostro workbook e anche creare stili personalizzati.
Come utilizzare gli stili incorporati
Il metodo Workbook.CreateBuiltinStyle 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 C# per utilizzare gli stili incorporati
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); |