ExportMode: CubeLoadClearMode;
ExportMode: Prognoz.Platform.Interop.Cubes.CubeLoadClearMode;
The ExportMode property determines a time series export mode.
If time series export mode is set, it is affected by value of the ExportMode property. For details see description of the ICubeMetaExporter.AutoPeriod property.
Executing the example requires that the repository contains a time series database with the TSDB identifier.
Add links to the Cubes, Dal, Db, Dt and Metabase system assemblies.
Sub UserProc;
Var
TextConsumer: IDtTextConsumer;
MB: IMetabase;
Exporter: ICubeMetaExporter;
Binding: ICubeMetaExporterBinding;
Begin
// Create a data consumer for export to text file
TextConsumer := New DtTextConsumer.Create;
TextConsumer.File := "C:\result_meta_exp.txt";
TextConsumer.FormatType := DtTextFormatType.Delimited;
TextConsumer.DelimitedColumnDelimiter := ";";
TextConsumer.DelimitedTextQualifier := """";
TextConsumer.Encoding := "WIN";
TextConsumer.WriteHeader := True;
// Create an object for export
Exporter := New CubeMetaExporterClass.Create;
// Get current repository
MB := MetabaseClass.Active;
// Specify data source and data consumer
Exporter.Rubricator := MB.ItemById("TSDB").Bind As IRubricator;
Exporter.Consumer := TextConsumer As IDtConsumer;
// Add a calendar binding
Binding := Exporter.Bindings.Add;
Binding.FieldName := "Year";
Binding.DataType := DbDataType.String;
Binding.BindingType := CubeMetaExporterBindingType.Calendar;
Binding.DateFormat := "$Year$";
Binding.ValueFieldName := "Value";
Binding.ValueDataType := DbDataType.Float;
// Specify that only point values are exported
Exporter.ExportMode := CubeLoadClearMode.DataOnly;
// Execute export
Exporter.ClearBeforeExport := True;
Exporter.Export;
End Sub UserProc;
After executing the example only point values are loaded to the C:\result_meta_exp.txt file.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Dt;
…
Public Shared Sub Main(Params: StartParams);
Var
TextConsumer: IDtTextConsumer;
MB: IMetabase;
Exporter: ICubeMetaExporter;
Binding: ICubeMetaExporterBinding;
Begin
// Create a data consumer for export to text file
TextConsumer := New DtTextConsumer.Create();
TextConsumer.File := "C:\result_meta_exp.txt";
TextConsumer.FormatType := DtTextFormatType.tftDelimited;
TextConsumer.DelimitedColumnDelimiter := ";";
TextConsumer.DelimitedTextQualifier := """";
TextConsumer.Encoding := "WIN";
TextConsumer.WriteHeader := True;
// Create object for export
Exporter := New CubeMetaExporterClass.Create();
// Get current repository
MB := Params.Metabase;
// Specify data source and data consumer
Exporter.Rubricator := MB.ItemById["TSDB"].Bind() As IRubricator;
Exporter.Consumer := TextConsumer As IDtConsumer;
// Add a calendar binding
Binding := Exporter.Bindings.Add();
Binding.FieldName := "Year";
Binding.DataType := DbDataType.ddtString;
Binding.BindingType := CubeMetaExporterBindingType.cmebtCalendar;
Binding.DateFormat := "$Year$";
Binding.ValueFieldName := "Value";
Binding.ValueDataType := DbDataType.ddtFloat;
// Specify that only point values are exported
Exporter.ExportMode := CubeLoadClearMode.clcmDataOnly;
// Perform export
Exporter.ClearBeforeExport := True;
Exporter.Export();
End Sub;
See also: