إزالة القطاعة
Contents
[
Hide
]
إزالة القطاعة
لإزالة القطاعة في Microsoft Excel ، ما عليك سوى تحديد أداة التقطيع والضغط علىحذف زر. لتحقيق الحفظ باستخدام Aspose.Cells for Python via Java ، استخدم طريقة Worksheet.getSlicers (). remove (). سيتم إزالة القطاعة من ورقة العمل.
يقوم مقتطف الشفرة التالي بتحميل ملفنموذج لملف Excelالذي يحتوي على مقسم شرائح موجود. يقوم بالوصول إلى أداة التقطيع وإزالتها وحفظ ملفإخراج ملف Excel. تُظهر لقطة الشاشة التالية أداة التقطيع التي ستتم إزالتها.
عينة من الرموز
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 | |
# Load Source Excel file | |
workbook = Workbook("sampleRemovingSlicer.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Access the newly added slicer from slicer collection | |
slicer = worksheet.getSlicers().get(0) | |
# Remove slicer | |
worksheet.getSlicers().remove(slicer) | |
# Save the workbook in output XLSX format | |
workbook.save("outputRemovingSlicer.xlsx", SaveFormat.XLSX) | |
jpype.shutdownJVM() |