DeleteComment(TabSheet: ITabSheet; Row: Integer; Column: Integer; Key: Integer): IDataAreaComments;
TabSheet. Sheet table, which contains a data cell.
Row. Index of data cell row.
Column. Index of data cell column.
Key. Key of deleted comment.
The DeleteComment method delets comment with the specified key from the specified data cell.
The specified coordinates should correspond to the cell in the data cell range of any slice. The data cell range can be obtained using the IEaxGrid.SpecificRange property with the EaxRangeType.Internal parameter. To check if work with comments is available, use the IEaxDataAreaSource.HasCommentsSupport property.
The method results in the collection of all comments of the specified cell.
Executing the example requires that the repository contains a regular report with the REPORT identifier. The report has a standard cube as a data source, in which storing of comments for data cells is enabled. A slice and a table visualizer are created based on the data source.
Add links to the Express, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Report: IPrxReport;
DataArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
Grid: IEaxGrid;
TSheet: ITabSheet;
DataRange: ITabRange;
CommentManager: IDataAreaCommentManager;
Comments: IDataAreaComments;
Begin
Mb := MetabaseClass.Active;
Report := Mb.ItemById("REPORT").Open(Null) As IPrxReport;
// Analytical data area
DataArea := Report.DataArea;
Slice := DataArea.Slices.Item(0);
If Slice.Source.HasCommentsSupport Then
Grid := Slice.Views.Item(0) As IEaxGrid;
TSheet := Grid.TabSheet;
DataRange := Grid.SpecificRange(EaxRangeType.Internal);
// Comment manager
CommentManager := DataArea.CommentManager;
// Delete comment
Comments := CommentManager.Comments(TSheet, DataRange.Top, DataRange.Left);
CommentManager.DeleteComment(TSheet, DataRange.Top, DataRange.Left, Comments.Item(0).Key);
End If;
End Sub UserProc;
After executing the example the comment created as the first one is deleted from the first data cell.
See also: