IPivotTable.Attachments

Syntax

Attachments(Row: Integer; Column: Integer): ICubeAttachments;

Parameters

Row. Cell row index.

Column. Cell column index.

Description

The Attachments property returns attachments contained in the cell with the specified coordinates.

Comments

To work with attachments, one should set attachments storage location in table data source.

To determine whether one can work with attachments in the specified cell, use the IPivotTable.SupportWriteAttachments property.

To determine whether a cell contains attachments, use the IPivotTable.HasAttachments property.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The report should contain a table with attachments in cells.

Add links to the Cubes, Express, Metabase, Pivot system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    Table: IPivotTable;
    Cell: Boolean;
    Count: Integer;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get table display settings
    Pivot := Express.Pivot;
    Table := Pivot.ObtainTable;
    // Check if cell with the (1,1) coordinate can contain attachments
    Cell := Table.SupportWriteAttachments(11);
    If Cell Then
        Debug.WriteLine("Cell is available for working with attachments");
        // Check if cell contains attachments
        If Table.HasAttachments(11Then
            Count := Table.Attachments(11).Count;
            Debug.WriteLine("Number of attachments: " + Count.ToString);
        End If;
    Else
        Debug.WriteLine("Cell is unavailable for working with attachments");
    End If;
End Sub UserProc;

After executing the example the console displays information about whether the specified cell can work with attachments. If the cell contains attachments, their number is displayed. For example:

The cell is available for working with attachments

Number of attachments: 3

See also:

IPivotTable