Dilimleyici Biçimlendirme

Olası Kullanım Senaryoları

Microsoft Excel’de dilimleyiciyi sütun sayısını ayarlayarak veya stilini ayarlayarak biçimlendirebilirsiniz. Aspose.Cells for Python via .NET, bunu Slicer.number_of_columns ve Slicer.style_type özelliklerini kullanarak yapmanıza olanak tanır.

Aspose.Cells for Python Excel Kütüphanesi ile Dilimleyiciyi Nasıl Biçimlendirilir

Lütfen aşağıdaki kodu görün. İçinde bir dilimleyici içeren örnek Excel dosyasını yükler. Dilimleyiciye erişir ve sütun sayısını ve stil türünü ayarlar ve bu şekilde çıkış Excel dosyasını kaydeder. Ekran görüntüsü, örnek kodun çalıştırılmasından sonra dilimleyicinin nasıl göründüğünü gösterir.

todo:image_alt_text

Örnek Kod

from aspose.cells import SaveFormat, Workbook
from aspose.cells.slicers import SlicerStyleType
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Load sample Excel file containing slicer.
wb = Workbook("sampleFormattingSlicer.xlsx")
# Access first worksheet.
ws = wb.worksheets[0]
# Access the first slicer inside the slicer collection.
slicer = ws.slicers[0]
# Set the number of columns of the slicer.
slicer.number_of_columns = 2
# Set the type of slicer style.
slicer.style_type = SlicerStyleType.SLICER_STYLE_LIGHT6
# Save the workbook in output XLSX format.
wb.save("outputFormattingSlicer.xlsx", SaveFormat.XLSX)