Show contents 

Tab > Tab Assembly Interfaces > ITabSheet > ITabSheet.CreateExpander

ITabSheet.CreateExpander

Syntax

CreateExpander(Row: Integer; Column: Integer; Length; Integer; ExpanderKind: TabExpanderKind);

Parameters

Row. Index of the row that contains the cell with expander. Allowed parameter value is in the range [0;ITabSheet.RowsCount).

Column. Index of the column that contains the cell with expander. Admissible parameter value lies within the range [0; ITabSheet.ColumnsCount).

Length. Number of the rows or columns affected by expander. The parameter can also be negative.

ExpanderKind. Expander action area.

Description

The CreateExpander method allows to create an expander in the cell, the coordinates of which are passed as the Row and Column input parameters.

Comments

If the Length parameter is positive, the expander opens down and to the right, if the parameter is negative, the expander opens up and to the left.

To change expander state icon, use the ITabSheet.ExpanderOnPicture and ITabSheet.ExpanderOffPicture properties.

Example

Executing the example requires that the repository contains a regular report with the REP_TABSHEET identifier. The file system should contain two images: C:/On.gif and C:/Off.gif.

Add links to the Drawing, Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Rep: IPrxReport;
    SheetT: IPrxTable;
    Tab: ITabSheet;
    TImg: ITabImages;
    ExpOn, ExpOff: Integer;
Begin
    MB := MetabaseClass.Active;
    Rep := MB.ItemById("REP_TABSHEET").Edit As IPrxReport;
    SheetT := Rep.ActiveSheet As IPrxTable;
    Tab := SheetT.TabSheet;
    Tab.CreateExpander(004, TabExpanderKind.Rows);
    Tab.ExpanderState(00) := TriState.OffOption;
    TImg := Tab.Images;
    ExpOn := TImg.Add(GxImage.FromFile("C:\On.gif"));
    ExpOff := TImg.Add(GxImage.FromFile("C:\Off.gif"));
    Tab.ExpanderOnPicture := ExpOn;
    Tab.ExpanderOffPicture := ExpOff;
    (Rep As IMetabaseObject).Save;
End Sub UserProc;

After executing the example an expander is created in the A0 cell of the regular report active sheet. Expander action is used for four rows, the expander is set to collapsed state. The images displaying expander states are also changed in the regular report.

See also:

ITabSheet