Affettatrice di formattazione
Contents
[
Hide
]
Possibili scenari di utilizzo
Puoi formattare l’affettatrice in Microsoft Excel impostando il suo numero di colonne o impostandone lo stile ecc. Aspose.Cells ti consente anche di farlo usando ilSlicer.NumberOfColumnseSlicer.StyleTypeproprietà.
Affettatrice di formattazione
Si prega di vedere il seguente codice, carica il fileesempio di file Excelche contiene un’affettatrice. Accede all’affettatrice e imposta il numero di colonne e il tipo di stile e lo salva comefile Excel di output. Lo screenshot mostra come l’affettatrice si occupa dell’esecuzione del codice di esempio.
Codice d’esempio
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 | |
// Load sample Excel file containing slicer. | |
Workbook wb = new Workbook("sampleFormattingSlicer.xlsx"); | |
// Access first worksheet. | |
Worksheet ws = wb.Worksheets[0]; | |
// Access the first slicer inside the slicer collection. | |
Aspose.Cells.Slicers.Slicer slicer = ws.Slicers[0]; | |
// Set the number of columns of the slicer. | |
slicer.NumberOfColumns = 2; | |
// Set the type of slicer style. | |
slicer.StyleType = Aspose.Cells.Slicers.SlicerStyleType.SlicerStyleLight6; | |
// Save the workbook in output XLSX format. | |
wb.Save("outputFormattingSlicer.xlsx", SaveFormat.Xlsx); |