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
Aspose.Cells for Python via Java supporta l’aggiunta del commento di List Object. Per questo, lo API fornisce ilListObject.Commentproprietà. Il commento aggiunto dalListObject.Commentproprietà sarà visibile all’interno delxl/tabelle/nometabella.xml file.
Lo screenshot seguente mostra il commento creato dal codice di esempio nel rettangolo rosso.
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
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
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") |