Dilimleyici Biçimlendirme
Contents
[
Hide
]
Dilimleyici Biçimlendirme
Microsoft Excel kullanarak, dilimleyiciyi sütun sayısını, stilleri vb. ayarlayabilirsiniz. Aspose.Cells for Python via Java, bunu elde etmek için Slicer.NumberOfColumns ve Slicer.StyleType özelliklerini sağlar.
Aşağıdaki kod parçası, 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 ayarları çıktı Excel dosyası olarak kaydeder. Ekran görüntüsü, örnek kodun çalıştırılmasından sonra dilimleyicinin nasıl göründüğünü gösterir.
Örnek Kod
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
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat, SlicerStyleType | |
# Load Source Excel file | |
workbook = Workbook("sampleFormattingSlicer.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Access the newly added slicer from slicer collection | |
slicer = worksheet.getSlicers().get(0) | |
# Set the number of columns of the slicer | |
slicer.setNumberOfColumns(2) | |
# Set the type of slicer style | |
slicer.setStyleType(SlicerStyleType.SLICER_STYLE_LIGHT_6) | |
# Save the workbook in output XLSX format | |
workbook.save("outputFormattingSlicer.xlsx", SaveFormat.XLSX) | |
jpype.shutdownJVM() |