CreateExpander(Row: Integer; Column: Integer; Length; Integer; ExpanderKind: TabExpanderKind);
CreateExpander(Row: integer; Column: integer; Length; integer; ExpanderKind: Prognoz.Platform.Interop.Tab.TabExpanderKind);
Row. Index of the row that contains the cell with expander. Admissible parameter value lies within 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. Type of hierarchy icon.
The CreateExpander method allows to create an expander in the cell, the coordinates of which are passed as the Row and Column input parameters.
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 icon, use the ITabSheet.ExpanderOnPicture and ITabSheet.ExpanderOffPicture properties.
To execute the example the repository must contain 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.Sheets.Item(0) As IPrxTable;
Tab := SheetT.TabSheet;
Tab.CreateExpander(0, 0, 4, TabExpanderKind.Rows);
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 new icons corresponding to the images C:/On.gif and C:/Off.gif respectively are assigned as the folded and unfolded expander icons.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Rep: IPrxReport;
SheetT: IPrxTable;
Tab: ITabSheet;
TImg: ITabImages;
ExpOn, ExpOff: Integer;
GxImg: GxImageClassClass = New GxImageClassClass.create();
Begin
MB := Params.Metabase;
Rep := MB.ItemById["REP_TABSHEET"].Edit() As IPrxReport;
SheetT := Rep.Sheets.Item[0] As IPrxTable;
Tab := SheetT.TabSheet;
Tab.CreateExpander(0, 0, 4, TabExpanderKind.tekRows);
TImg := Tab.Images;
ExpOn := TImg.Add(GxImg.FromFile("C:/On.gif"));
ExpOff := TImg.Add(GxImg.FromFile("C:/Off.gif"));
Tab.ExpanderOnPicture := ExpOn;
Tab.ExpanderOffPicture := ExpOff;
(Rep As IMetabaseObject).Save();
End Sub;
See also: