IDataAreaCommentManager.AddComment

Syntax

AddComment(TabSheet: ITabSheet; Row: Integer; Column: Integer; Text: String): IDataAreaComments;

Parameters

TabSheet. The sheet table, in which a comment for data cell is added.

Row. Index of data cell row.

Column. Index of data cell column.

Text. Text of added comment.

Description

The AddComment method adds a comment for the specified data cell.

Comments

The specified coordinates should correspond to the cell in the data cell range of any slice. The data 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 added for the specified cell.

Example

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(NullAs IPrxReport;
    // Analytical data area
    DataArea := Report.DataArea;
    Slice := DataArea.Slices.Item(0);
    If Slice.Source.HasCommentsSupport Then
        Grid := Slice.Views.Item(0as IEaxGrid;
        TSheet := Grid.TabSheet;
        DataRange := Grid.SpecificRange(EaxRangeType.Internal);
        // Comment manager
        CommentManager := DataArea.CommentManager;
        // Add a comment
        Comments := CommentManager.AddComment(TSheet, DataRange.Top, DataRange.Left, "First data cell");
        Debug.WriteLine("Number of cell comments: " + Comments.Count.ToString);
    End If;
End Sub UserProc;

After executing the example a new comment is added for the first data cell.

See also:

IDataAreaCommentManager