Esporta Excel in HTML con GridLines

Esporta Excel in HTML con GridLines

Il seguente codice di esempio crea una cartella di lavoro e riempie il suo foglio di lavoro con alcuni valori e quindi lo salva nel formato HTML dopo aver impostato ilHtmlSaveOptions.ExportGridLines aVERO.

Lo screenshot seguente mostra l’output HTML generato con questo codice di esempio. Come puoi vedere, mostra anche le linee della griglia nell’output HTML.

cose da fare:immagine_alt_testo

// 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);