Impostare il commento dell'oggetto tabella o elenco
Contents
[
Hide
]
Impostare il commento della tabella o dell’oggetto elenco all’interno del foglio di lavoro
Si prega di impostare il commento della tabella o dell’oggetto elenco all’interno del foglio di lavoro utilizzando ilListObject.Commentproprietà. Il commento sarà visibile all’interno del file xl/tables/tableName.xml.
Il codice di esempio seguente carica il filefile excel di origine, imposta il commento del primo oggetto tabella o elenco all’interno del foglio di lavoro e lo screenshot mostra il commento creato da questo codice nel rettangolo rosso.
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.getSharedDataDir(SettheCommentofTableorListObject.class) + "tables/"; | |
// Open the template file. | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access first worksheet. | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Access first list object or table. | |
ListObject lstObj = worksheet.getListObjects().get(0); | |
// Set the comment of the list object | |
lstObj.setComment("This is Aspose.Cells comment."); | |
// Save the workbook in xlsx format | |
workbook.save(dataDir + "STheCofTOrListObject_out.xlsx", SaveFormat.XLSX); |