Esporta la cartella di lavoro del documento e le proprietà del foglio di lavoro in Excel alla conversione HTML
Contents
[
Hide
]
Possibili scenari di utilizzo
Quando il file Excel Microsoft viene esportato in HTML utilizzando Microsoft Excel o Aspose.Cells, esporta anche vari tipi di proprietà Documento, Cartella di lavoro e Foglio di lavoro come mostrato nello screenshot seguente. È possibile evitare di esportare queste proprietà impostando il fileHtmlSaveOptions.ExportDocumentProperties, HtmlSaveOptions.ExportWorkbookPropertieseHtmlSaveOptions.ExportWorksheetProperties comefalso . Il valore predefinito di queste proprietà èVERO. Lo screenshot seguente mostra l’aspetto di queste proprietà nel codice HTML esportato.
Esporta le proprietà di documenti, cartelle di lavoro e fogli di lavoro in Excel alla conversione HTML
Il codice di esempio seguente carica il fileesempio di file Excel e lo converte in HTML e non esporta le proprietà Documento, Cartella di lavoro e Foglio di lavoro inuscita HTML.
Codice d’esempio
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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load the sample Excel file | |
Workbook workbook = new Workbook("sampleExportDocumentWorkbookAndWorksheetPropertiesInHTML.xlsx"); | |
//Specify Html Save Options | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
//We do not want to export document, workbook and worksheet properties | |
options.ExportDocumentProperties = false; | |
options.ExportWorkbookProperties = false; | |
options.ExportWorksheetProperties = false; | |
//Export the Excel file to Html with Html Save Options | |
workbook.Save("outputExportDocumentWorkbookAndWorksheetPropertiesInHTML.html", options); |