Excel a HTML - Usa l'opzione PresentationPreference per un layout migliore
Contents
[
Hide
]
Aspose.Cells fornisce una proprietà utile,HtmlSaveOptions.PresentationPreference , che gli sviluppatori possono utilizzare per ottenere un layout migliore durante il salvataggio di un file Excel Microsoft nel formato HTML o MHT. Il valore predefinito della proprietà èfalso . Si consiglia di impostare questa proprietà suVERO per ottenere presentazioni dall’aspetto migliore da un report di 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ExceltoHTMLPresentationPreferenceOption.class); | |
// Instantiate the Workbook | |
// Load an Excel file | |
Workbook workbook = new Workbook(dataDir + "HiddenCol.xlsx"); | |
// Create HtmlSaveOptions object | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Set the Presenation preference option | |
options.setPresentationPreference(true); | |
// Save the Excel file to HTML with specified option | |
workbook.save(dataDir + "outPresentationlayout1.html"); |
Potresti trovare utili i seguenti articoli riguardanti la conversione da Excel a HTML
- Impedisci l’esportazione di contenuti nascosti del foglio di lavoro durante il salvataggio in HTML
- Esporta foglio di lavoro CSS separatamente nell’output HTML
- Disabilita i commenti rivelati di livello inferiore durante il salvataggio in HTML
- Esporta la cartella di lavoro del documento e le proprietà del foglio di lavoro in Excel alla conversione HTML
- Esporta l’intervallo dell’area di stampa in HTML