Excel to HTML Utilizzare l Opzione PresentationPreference per una Migliore Layout
Contents
[
Hide
]
Aspose.Cells per Python via .NET offre una proprietà utile HtmlSaveOptions.PresentationPreference per gli sviluppatori che necessitano di un layout migliore al momento di salvare un file Microsoft Excel in formato HTML o MHT. Il valore predefinito di questa proprietà è false. Si raccomanda di impostarla su true per ottenere una presentazione più attraente dei report Excel.
Si prega di vedere il codice di esempio di seguito che dimostra come renderizzare un file HTML da un report Excel con preferenza di presentazione attiva.
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) |