Rendering del filtro
Contents
[
Hide
]
Possibili Scenari di Utilizzo
Aspose.Cells per Python via .NET supporta il rendering della forma del filtro. Se converti il tuo foglio di lavoro in un’immagine o salvi il tuo lavoro nei formati PDF o HTML, vedrai che i filtri vengono resi correttamente.
Come renderizzare il filtro utilizzando la libreria Excel Aspose.Cells per Python
Il seguente codice di esempio carica il file Excel di esempio che contiene un filtro esistente. Converte il foglio di lavoro in un’immagine impostando l’area di stampa che copre solo il filtro. L’immagine di seguito è la immagine di output che mostra il filtro renderizzato. Come puoi vedere, il filtro è stato renderizzato correttamente e appare identico al file Excel di esempio.
Codice di Esempio
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
from aspose.cells import Workbook | |
from aspose.cells.drawing import ImageType | |
from aspose.cells.rendering import ImageOrPrintOptions, SheetRender | |
# 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("sampleRenderingSlicer.xlsx") | |
# Access first worksheet. | |
ws = wb.worksheets[0] | |
# Set the print area because we want to render slicer only. | |
ws.page_setup.print_area = "B15:E25" | |
# Specify image or print options, set one page per sheet and only area to true. | |
imgOpts = ImageOrPrintOptions() | |
imgOpts.horizontal_resolution = 200 | |
imgOpts.vertical_resolution = 200 | |
imgOpts.image_type = ImageType.PNG | |
imgOpts.one_page_per_sheet = True | |
imgOpts.only_area = True | |
# Create sheet render object and render worksheet to image. | |
sr = SheetRender(ws, imgOpts) | |
sr.to_image(0, "outputRenderingSlicer.png") |