Regular expanders are displayed in the table by default:
. Expanded expander.
. Collapsed expander.
Custom expanders can be set up in the development environment in the Fore language using the ITabSheet.ExpanderOnPicture and ITabSheet.ExpanderOffPicture properties.
To display custom expanders:
Select icon storage option:
In the file system.
Execute the unit depending on the selected icon storage option:
For resource. Executing the example requires that the repository contains a regular report with the REP_ID identifier and a resource with the RES_ID identifier containing two images for expanders with the ID_EXPOn and ID_EXPOff identifiers. Add links to the Drawing, IO, Metabase, Report, and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
SheetT: IPrxTable;
Tab: ITabSheet;
TImg: ITabImages;
ExpOn, ExpOff: Integer;
Res: IResourceObject;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get regular report
Rep := MB.ItemById("REP_ID").Edit As IPrxReport;
// Get table from report sheet
SheetT := Rep.ActiveSheet As IPrxTable;
Tab := SheetT.TabSheet;
// Get custom expander image from resources
Res := MetabaseClass.Active.ItemById("RES_ID").Bind As IResourceObject;
TImg := Tab.Images;
// Clear collection of images
TImg.RemoveAll(True);
// Get image for expanded expander from resource
ExpOn := TImg.Add(GxImage.FromStream(Res.Binaries.Value("ID_EXPOn")));
// Get image for collapsed expander from resource
ExpOff := TImg.Add(GxImage.FromStream(Res.Binaries.Value("ID_EXPOff")));
// Set custom expanders
Tab.ExpanderOnPicture := ExpOn;
Tab.ExpanderOffPicture := ExpOff;
(Rep As IMetabaseObject).Save;
End Sub UserProc;
for file system. Executing the example requires that the repository contains a regular report with the REP_ID identifier, and the file system contains two images On.png and Off.png. Add links to the Drawing, IO, Metabase, Report, and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
SheetT: IPrxTable;
Tab: ITabSheet;
TImg: ITabImages;
ExpOn, ExpOff: Integer;
Res: IResourceObject;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get regular report
Rep := MB.ItemById("REP_ID").Edit As IPrxReport;
// Get table from report sheet
SheetT := Rep.ActiveSheet As IPrxTable;
Tab := SheetT.TabSheet;
// Get collection of table area images
TImg := Tab.Images;
// Clear collection of images
TImg.RemoveAll(True);
// Get image for expanded expander from the file system
ExpOn := TImg.Add(GxImage.FromFile("С:\On.png"));
// Get image for collapsed expander from the file system
ExpOff := TImg.Add(GxImage.FromFile("C:\Off.png"));
// Set custom expanders
Tab.ExpanderOnPicture := ExpOn;
Tab.ExpanderOffPicture := ExpOff;
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the operations, custom expanders are displayed:
See also: