Esportare Excel in HTML con linee della griglia
Contents
[
Hide
]
Se si desidera esportare il file Excel in HTML con linee della griglia, utilizzare la proprietà HtmlSaveOptions.ExportGridLines e impostarla su true.
Esportare Excel in HTML con linee della griglia
Il seguente codice di esempio crea un foglio di lavoro, lo riempie con alcuni valori e quindi lo salva in formato HTML dopo aver impostato la HtmlSaveOptions.ExportGridLines a true.
La seguente schermata mostra l’HTML di output generato con questo codice di esempio. Come si può vedere, mostra anche le linee della griglia nell’HTML di output.
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(ExportExceltoHTML.class); | |
// Create your workbook | |
Workbook wb = new Workbook(); | |
// Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
// Fill worksheet with some integer values | |
for (int r = 0; r < 10; r++) { | |
for (int c = 0; c < 10; c++) { | |
ws.getCells().get(r, c).putValue(r * 1); | |
} | |
} | |
// Save your workbook in HTML format and export gridlines | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.setExportGridLines(true); | |
wb.save(dataDir + "output.html", opts); |