Biçimlendirme Dilimleyici

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.

yapılacaklar:resim_alternatif_metin

Basit kod

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()