Esporta le proprietà del documento, della cartella di lavoro e del foglio di lavoro nella conversione di Excel in HTML con Node.js tramite C++
Possibili Scenari di Utilizzo
Quando si esporta un file Microsoft Excel in HTML usando Microsoft Excel o Aspose.Cells for Node.js via C++, vengono esportate anche varie proprietà di Documento, Cartella di Lavoro e Foglio di Lavoro come mostrato nella schermata seguente. Puoi evitare di esportare queste proprietà impostando HtmlSaveOptions.getExportDocumentProperties(), HtmlSaveOptions.getExportWorkbookProperties() e HtmlSaveOptions.getExportWorksheetProperties() su false. Il valore predefinito di queste proprietà è true. La schermata seguente mostra come appaiono in HTML esportato.
Esportare le proprietà del documento, del foglio di lavoro e del foglio di calcolo in HTML
Il codice di esempio di seguito carica il file Excel di esempio e lo converte in HTML senza esportare le proprietà di Documento, Cartella di Lavoro e Foglio di Lavoro nell'output HTML.
Codice di Esempio
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sampleExportDocumentWorkbookAndWorksheetPropertiesInHTML.xlsx");
// Load the sample Excel file
const workbook = new AsposeCells.Workbook(filePath);
// Specify Html Save Options
const options = new AsposeCells.HtmlSaveOptions();
// We do not want to export document, workbook and worksheet properties
options.setExportDocumentProperties(false);
options.setExportWorkbookProperties(false);
options.setExportWorksheetProperties(false);
// Export the Excel file to Html with Html Save Options
workbook.save("outputExportDocumentWorkbookAndWorksheetPropertiesInHTML.html", options);