EndDateParamId: String;
EndDateParamId: string;
The EndDateParamId property determines identifier of the parameter that sets the end date of displaying data in the workbook.
The parameter defined in the EndDateParamId property must be of the Date And Time type to work correctly (DbDataType.DateTime) or Date (DbDataType.Date). To determine parameter type, use the IMetabaseObjectParam.DataType property.
If the EndDateParamId value is not set, the date of workbook data display end is determined with the ILaner.EndDate property.
If the EndDateParamId and ILaner.EndDate properties are set, the date of workbook data display end is determined with the last set property.
The date of data display end must be greater than that of data display start. To set the parameter determining the date of workbook data display start, use the ILaner.StartDateParamId property.
The EndDateParamId property affects only the data display in the workbook. To determine the calculation options of a specific series, use the ILanerTransformPeriod interface.
Executing the example requires a form with the LanerBox component and the UiErAnalyzer component with the UiErAnalyzer1 identifier, that is a data source for LanerBox. Repository must contain a workbook with the WBK identifier.
Add links to the Dal and Metabase system assemblies.
Sub SetWbkParam;
Var
mb: Imetabase;
Wbk: IMetabaseObject;
WbkParams: IMetabaseObjectParams;
Param: IMetabaseObjectParam;
Eax: IEaxAnalyzer;
Laner: ILaner;
ObjI: ImetabaseObjectInstance;
Begin
mb := MetabaseClass.Active;
// Get workbook
Wbk := mb.ItemById("WBK").Edit;
// Get workbook parameters
WbkParams := Wbk.Params;
// Clear collection of parameters
WbkParams.Clear;
// Add parameter
// determining the date of data display start
Param := WbkParams.Add;
Param.DataType := DbDataType.Date;
Param.DefaultValue := "01.01.2002";
Param.Id := "START_DATE";
Param.Name := "Start date";
// Add parameter
// determining the date of data display end
Param := WbkParams.Add;
Param.DataType := DbDataType.Date;
Param.Id := "END_DATE";
Param.Name := "End date";
Param.DefaultValue := "31.12.2010";
// Save changes
Wbk.Save;
// Get object to set up workbook
Wbk.Bind;
Eax := Wbk As IEaxAnalyzer;
Laner := Eax.Laner;
// Set start and end dates of data display with parameters
Laner.StartDateParamId := "START_DATE";
Laner.EndDateParamId := "END_DATE";
// Open the workbook with parameter values by default
ObjI := Wbk.Open(Eax.OwnParamValues);
UiErAnalyzer1.Active := False;
UiErAnalyzer1.Instance := ObjI;
UiErAnalyzer1.Active := True;
End Sub SetWbkParam;
After executing the example the WBK workbook contains parameters determining start and end dates of data display. The workbook is opened to view in LanerBox by the values of parameters set by default.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Dal;
…
Public Sub SetWbkParam();
Var
mb: Imetabase;
Wbk: IMetabaseObject;
WbkParams: IMetabaseObjectParams;
Param: IMetabaseObjectParam;
Eax: IEaxAnalyzer;
Laner: ILaner;
ObjI: ImetabaseObjectInstance;
Begin
mb := Self.Metabase;
// Get workbook
Wbk := mb.ItemById["OBJ42890_COPY2"].Edit();
// Get workbook parameters
WbkParams := Wbk.Params;
// Clear collection of parameters
WbkParams.Clear();
// Add parameter
// determining the date of data display start
Param := WbkParams.Add();
Param.DataType := DbDataType.ddtDate;
Param.DefaultValue := "01.01.2002";
Param.Id := "START_DATE";
Param.Name := "Start date";
// Add parameter
// determining the date of data display end
Param := WbkParams.Add();
Param.DataType := DbDataType.ddtDate;
Param.Id := "END_DATE";
Param.Name := "End date";
Param.DefaultValue := "31.12.2010";
// Save changes
Wbk.Save();
// Get object to set up workbook
Wbk.Bind();
Eax := Wbk As IEaxAnalyzer;
Laner := Eax.Laner;
// Set start and end dates of data display with parameters
Laner.StartDateParamId := "START_DATE";
Laner.EndDateParamId := "END_DATE";
// Open the workbook with values of parameters by default
ObjI := Wbk.Open(Eax.OwnParamValues);
uiErAnalyzerNet1.AnalyzerUi.Instance := ObjI;
uiErAnalyzerNet1.Active := True;
End Sub SetWbkParam;
See also: