If workbooks of the time series database are registered in the same context, their data is synchronized. When series values change in one of the workbooks, the corresponding data is updated in all the series that have the same values of mandatory attributes.
The ILanerContext interface is used to work with context. Let us execute the example of placing two workbooks of the same time series database to the context. This requires a form and the following components:
Button (the Button1 identifier).
Two UiErAnalyzer components (named UiErAnalyzer1 and UiErAnalyzer2).
Two LanerBox components (named LanerBox1 and the LanerBox2).
The UiErAnalyzer1 component is a data source for LanerBox1, and the UiErAnalyzer2 is a data source for LanerBox2. Workbooks of the same time series database must be loaded to the UiErAnalyzer components.
The procedure listed below must be set as a handler of the OnClick event for the Button1 button:
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Context: ILanerContext;
Laner: ILaner;
Begin
Context := New LanerContext.Create;
// Registering the first workbook
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
Context.Register(Laner);
// Registering the second workbook
Laner := UiErAnalyzer2.ErAnalyzer.Laner;
Context.Register(Laner);
End Sub Button1OnClick;
On clicking the Button1 button the workbooks are registered in one context.
The first workbook series:
The second workbook series:
Changing the values of the series in the first workbook:
The second workbook series data is synchronized with the first workbook series data:
See also: