De Excel a HTML Usa la Opción PresentationPreference para un Mejor Diseño
Contents
[
Hide
]
Aspose.Cells para Python via .NET ofrece una propiedad útil HtmlSaveOptions.PresentationPreference para desarrolladores que necesitan un mejor diseño al guardar un archivo Microsoft Excel en formato HTML o MHT. El valor predeterminado de la propiedad es falso. Recomendamos configurar esta propiedad en true para obtener una presentación más atractiva de los informes de Excel.
Por favor mira el código de muestra abajo que demuestra cómo renderizar un archivo HTML desde un informe de Excel con preferencia de presentación.
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 HtmlSaveOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Instantiate the Workbook | |
# Load an Excel file | |
workbook = Workbook(dataDir + "sample.xlsx") | |
# Create HtmlSaveOptions object | |
options = HtmlSaveOptions() | |
# Set the Presenation preference option | |
options.presentation_preference = True | |
# Save the Excel file to HTML with specified option | |
workbook.save(dataDir + "outPresentationlayout1.out.html", options) |