IDtExcelConsumerEx.File

Syntax

File: String;

Description

The File property determines the entire name of the file, in which data will be loaded.

Comments

The name of the sheet, on which data is loaded, is determined by the IDtExcelConsumerEx.Sheet property.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. This database contains the COUNTRY indicators attribute that is a link to the dictionary.

Add links to the Cubes, Dal, Dimensions, Dt, and Metabase system assemblies.

Sub UserProc;
    Consumer: DtExcelConsumerEx;
    MB: IMetabase;
    Exporter: ICubeMetaExporter;
    Binding: ICubeMetaExporterBinding;
Begin
// Data consumer for export to Excel
    Consumer := New DtExcelConsumerEx.Create;
    Consumer.File := "C:\result.xlsx";
    Consumer.HasHeader := True;
    Consumer.Sheet := "Sheet1";
// Export parameters
    Exporter := New CubeMetaExporterClass.Create;
    MB := MetabaseClass.Active;
    Exporter.Rubricator := MB.ItemById("FC").Bind As IRubricator;
    Exporter.Consumer := Consumer As IDtConsumer;
// The COUNTRY attribute export parameters
    Binding := Exporter.Bindings.Add;
    Binding.FieldName := "CountryKey";
    Binding.DataType := DbDataType.Integer;
    Binding.BindingType := CubeMetaExporterBindingType.Attribute;
    Binding.Attribute := "COUNTRY";
    Binding.KeyField := "KEY";
// Values export parameters  
    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;
    Exporter.ByColumns := False;
    Exporter.CalendarLevel := DimCalendarLevel.Year;
// Export
    Exporter.Export;
End Sub UserProc;

After executing the example data from the specified time series database is loaded to the C:\result.xlsx file on the Sheet1 sheet.

See also:

IDtExcelConsumerEx