Biçimlendirme Dilimleyici
Contents
[
Hide
]
Biçimlendirme Dilimleyici
Microsoft Excel’i kullanarak, dilimleyiciyi sütun sayısını, stilleri vb.
Aşağıdaki kod parçacığı,örnek excel dosyasıbir dilimleyici içerir. Dilimleyiciye erişir ve sütun sayısını ve stil tipini ayarlar ve şu şekilde kaydeder:çıktı excel dosyası. Ekran görüntüsü, örnek kodun yürütülmesinden sonra dilimleyicinin nasıl göründüğünü gösterir.
Basit kod
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
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() |