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(BuiltinStyleType) e l’enumerazione BuiltinStyleType rendono comodo l’uso degli stili incorporati. Ecco un elenco di tutti gli stili incorporati possibili:
- TwentyPercentAccent1
- TwentyPercentAccent2
- TwentyPercentAccent3
- QuindiciPercentAccent4
- QuindiciPercentAccent5
- QuindiciPercentAccent6
- QuarantaPercentAccent1
- QuarantaPercentAccent2
- QuarantaPercentAccent3
- QuarantaPercentAccent4
- QuarantaPercentAccent5
- QuarantaPercentAccent6
- SessantaPercentAccent1
- SessantaPercentAccent2
- SessantaPercentAccent3
- SessantaPercentAccent4
- SessantaPercentAccent5
- SessantaPercentAccent6
- Accent1
- Accent2
- Accent3
- Accent4
- Accent5
- Accent6
- Cattivo
- Calcolo
- VerificaCella
- Virgola
- Virgola1
- Valuta
- Valuta1
- TestoEsplicativo
- Buono
- Intestazione1
- Intestazione2
- Intestazione3
- Intestazione4
- Collegamento ipertestuale
- CollegamentoIpertestuale
- Input
- CellaaCollegata
- Neutrale
- Normale
- Nota
- Output
- Percentuale
- Titolo
- Totale
- TestoAvviso
- LivelloRiga
- LivelloColonna
Codice Node.js per utilizzare stili incorporati
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
const path = require("path"); | |
const AsposeCells = require("aspose.cells.node"); | |
// The path to the documents directory. | |
const dataDir = path.join(__dirname, "data"); | |
const output1Path = path.join(dataDir, "Output.xlsx"); | |
const output2Path = path.join(dataDir, "Output.out.ods"); | |
const workbook = new AsposeCells.Workbook(); | |
const style = workbook.createBuiltinStyle(AsposeCells.BuiltinStyleType.Title); | |
const cell = workbook.getWorksheets().get(0).getCells().get("A1"); | |
cell.putValue("Aspose"); | |
cell.setStyle(style); | |
const worksheet = workbook.getWorksheets().get(0); | |
worksheet.autoFitColumn(0); | |
worksheet.autoFitRow(0); | |
workbook.save(output1Path); | |
console.log(`File saved ${output1Path}`); | |
workbook.save(output2Path); | |
console.log(`File saved ${output2Path}`); |