Report: Boolean;
The Report property determines whether a control will be used on all sheets.
Available values:
True. Control will be displayed on all sheets. Default value.
False. Control will be displayed on specific sheets.
Use the IPrxControlAppearance.Sheet property to determine the sheets, on which a control will be displayed.
Executing the example requires that the repository contains a regular report with the REPORT identifier. One of data source dimensions is a dictionary with the D_To identifier.
Add links to the Metabase, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
Ctrls: IPrxReportControls;
Ctrl: IPrxControl;
Sheet: IPrxSheet;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get regular report
Rep := MB.ItemById("REPORT").Edit As IPrxReport;
// Get collection of controls
Ctrls := Rep.Controls.Edit;
// Add a drop-down list
Ctrl := Ctrls.Add(Null);
Ctrl.AutoRecalc := True;
Ctrl.Binding := "UI=""DimCombo""";
Ctrl.Dimension := Rep.DataSources.Item(0).Slices.FindByName("Slice1").Dimensions.FindById("D_TO");
Ctrl.Appearance.Report := False;
Ctrl.Appearance.Sheet(Rep.Sheets.Item(0)) := True;
Ctrl.Appearance.Sheet(Rep.Sheets.Item(1)) := True;
// Add integer editor
Ctrl := Ctrls.Add(Null);
Ctrl.AutoRecalc := True;
Ctrl.Binding := "UI=""IntegerEdit""VALUE=""50""";
Ctrl.Appearance.Report := False;
Ctrl.Appearance.Sheet(Rep.Sheets.Item(0)) := True;
Ctrl.Appearance.Sheet(Rep.Sheets.Item(1)) := True;
Ctrls.Save;
// Determine order of controls for Sheet1
Sheet := Rep.Sheets.Item(0);
Rep.Controls.SheetControls(Sheet).Move(1, 0);
End Sub UserProc;
After executing the example two controls are created for the two first report sheets. Order of elements is changed for the first sheet.
See also: