Impostare il commento dell'oggetto tabella o elenco

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.

cose da fare:immagine_alt_testo

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

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")