Imposta il commento dell oggetto tabella o elenco
Contents
[
Hide
]
Imposta il commento della tabella o dell’oggetto lista all’interno del foglio di lavoro
Aspose.Cells for Python via Java supporta l’aggiunta del commento dell’oggetto elenco. A tal fine, l’API fornisce la proprietà ListObject.Comment. Il commento aggiunto dalla proprietà ListObject.Comment sarà visibile all’interno del file xl/tables/tableName.xml.
La seguente schermata mostra il commento creato dal codice di esempio nel rettangolo rosso.
Il seguente codice di esempio carica il file excel di origine, imposta il commento della prima tabella o oggetto elenco all’interno del foglio di lavoro
This file contains hidden or 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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
workbook = Workbook(source_directory + "source.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Access first list object or table | |
listObj = worksheet.getListObjects().get(0) | |
# Set the comment of the list object | |
listObj.setComment("This is Aspose.Cells comment.") | |
# Save the excel file. | |
workbook.save(output_directory + "STheCofTOrListObject_out.xlsx") |