IPrxControl.SetValueC

Fore Syntax

SetValueC(Value: Variant; [Context: IPrxReportRecalcContext = Null]): IPrxReportRecalcContext;

Fore.NET Syntax

SetValueC(Value: Object; [Context: Prognoz.Platform.Interop.Report.IprxReportRecalcContext]): Prognoz.Platform.Interop.Report.IprxReportRecalcContext;

Parameters

Value. Value of control.

Context. Report calculation parameters. If this parameter is not specified, new parameters of report calculation are created.

Description

The SetValueC method sets value of a control and report recalculation.

Comments

The value that is specified in the Value parameter depends on the control type in use. The available values are described in comments to the IPrxControl.Value property.

Fore Example

Executing the example requires a form with connected regular report.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Rep: IPrxReport;
    Ctrl: IPrxControl;
    Cont: IPrxReportRecalcContext;
    Context: IPrxReportRecalcContext;
    Sheet: IPrxSheet;
    Tab: IPrxTable;
Begin
    Rep := UiReport1.Instance 
As IPrxReport;
    Ctrl := Rep.Controls.FindById(
"Item");
    Context := Rep.CreateRecalcContext;
    Sheet := Rep.Sheets.Item(
0);
    Context.RecalcSheet(Sheet) := TriState.OnOption;
    Tab := Rep.ActiveSheet 
As IPrxTable;
    Cont := Ctrl.SetValueC(Tab.TabSheet.ParseRange(
"A0").Value, Context);
End Sub Button1OnClick;

After executing the example the value of the control with the Item identifier is changed. A new value is taken from the A0 cell of the active sheet of the regular report. After setting the new value the report is recalculated.

Fore.NET Example

Executing the example requires a form with connected regular report.

Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Stat;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.ForeSystem;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Rep: IPrxReport;
    Ctrl: IPrxControl;
    Cont: IPrxReportRecalcContext;
    Context: IPrxReportRecalcContext;
    Sheet: IPrxSheet;
    Tab: IPrxTable;
Begin
    Rep := UiReportNet1.ReportUi.Instance As IPrxReport;
    Ctrl := Rep.Controls.FindById("Item");
    Context := Rep.CreateRecalcContext();
    Sheet := Rep.Sheets.Item[0];
    Context.RecalcSheet[Sheet] := TriState.tsOnOption;
    Tab := Rep.ActiveSheet As IPrxTable;
    Cont := Ctrl.SetValueC(Tab.TabSheet.ParseRange("A0").Value, Context);
End Sub;

After executing the example the value of the control with the Item identifier is changed. A new value is taken from the A0 cell of the active sheet of the regular report. After setting the new value the report is recalculated.

See also:

IPrxControl