テーブルまたはリスト オブジェクトのコメントを設定する

ワークシート内のテーブルまたはリスト オブジェクトのコメントを設定する

を使用して、ワークシート内のテーブルまたはリスト オブジェクトのコメントを設定してください。ListObject.コメント財産。コメントは xl/tables/tableName.xml ファイル内に表示されます。

次のサンプル コードは、ソースエクセルファイル、ワークシート内の最初のテーブルまたはリスト オブジェクトのコメントを設定します。スクリーンショットは、このコードによって作成されたコメントを赤い四角形で示しています。

todo:画像_代替_文章

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