CalcOnChangedData: TriState;
CalcOnChangedData: Prognoz.Platform.Interop.ForeSystem.TriState;
The CalcOnChangedData property determines whether formula calculation is applied to changed data without saving data to dashboard.
Available values:
TriState.OnOption. Formulas are calculated on changed data.
TriState.OffOption. Formulas are not calculated on changed data.
TriState.Undefined. Default value. Formulas are not calculated on changed data.
Executing the example requires that the repository contains a dashboard with the DASHBOARD_CALC identifier.
Add links to the Adhoc, Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
mb: IMetabase;
DashboardObj: IMetabaseObject;
Dashboard: IAdhocReport;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get dashboard
DashboardObj := mb.ItemById("DASHBOARD_CALC").Edit;
Dashboard := DashboardObj As IAdhocReport;
// Set formula calculation on changed data
If (Dashboard.CalcOnChangedData = TriState.OffOption) Or (Dashboard.CalcOnChangedData = TriState.Undefined) Then
Dashboard.CalcOnChangedData := TriState.OnOption;
End If;
// Save dashboard
DashboardObj.Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.AdHoc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
DashboardObj: IMetabaseObject;
Dashboard: IAdhocReport;
Begin
// Get repository
mb := Params.Metabase;
// Get dashboard
DashboardObj := mb.ItemById["DASHBOARD_CALC"].Edit();
Dashboard := DashboardObj As IAdhocReport;
// Set formula calculation on changed data
If (Dashboard.CalcOnChangedData = Prognoz.Platform.Interop.ForeSystem.TriState.tsOffOption)
Or (Dashboard.CalcOnChangedData = Prognoz.Platform.Interop.ForeSystem.TriState.tsUndefined) Then
Dashboard.CalcOnChangedData := Prognoz.Platform.Interop.ForeSystem.TriState.tsOnOption;
End If;
// Save dashboard
(DashboardObj As IMetabaseObject).Save();
End Sub;
After executing the example, formula calculation on changed data without their saving will be enabled for dashboard.
See also: