ICubeMetaLoader.TestLoad

Syntax

TestLoad: ICubeMetaLoaderTestLoadResult;

Description

The TestLoad method implements test loading of time series from data source and returns object that contains results.

Comments

During text loading data is checked, loaded data is not saved.

Example

Executing the example requires a time series database with the OBJ_FC identifier and a time series export file C:\Fixed.xlsx. Also, MDM repository with the MDM_REPO identifier must be present in the repository. There should be dictionaries with the DICT_CTR, DICT_IND and UNITS identifiers in this repository. The COUNTRY attribute of the time series database refers to the DICT_CTR dictionary, the INDICATOR attribute is a link to the DICT_IND dictionary, and measurement units refer to the UNITS dictionary.

Add links to the Metabase, Cube, Dt, Db, Dimension system assemblies.

The C:\Fixed.xlsx file, for which the example is created

<font color="#008080">Sub</font><font color="#000000">&nbsp;UserProc;<br /> </font><font color="#008080">Var</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;Mb:&nbsp;IMetabase;<br /> &nbsp;&nbsp;&nbsp;&nbsp;NsiDescr:&nbsp;IMetabaseObjectDescriptor;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader:&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo:&nbsp;IMetabaseObjectCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj:&nbsp;IMetabaseObject;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ObjDesc:&nbsp;IMetabaseObjectDescriptor;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoaderBindings:&nbsp;ICubeMetaLoaderBindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;UnitBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LevelBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ValueBinding:&nbsp;ICubeMetaLoaderBinding;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser:&nbsp;ICubeMetaLoaderBindingParser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel:&nbsp;IDtExcelProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Provider:&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Log:&nbsp;ICubeMetaLoaderLog;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Entry:&nbsp;ICubeMetaLoaderLogEntry;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Count,&nbsp;i,&nbsp;key:&nbsp;Integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TestResult:&nbsp;ICubeMetaLoaderTestLoadResult;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TestResultEntry:&nbsp;ICubeMetaLoaderTestLoadResultEntry;<br /> </font><font color="#008080">Begin</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;Mb&nbsp;:=&nbsp;MetabaseClass.Active;<br /> &nbsp;&nbsp;&nbsp;&nbsp;NsiDescr&nbsp;:=&nbsp;Mb.ItemById(</font><font color="#800000">&quot;RDS_REPO&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Create&nbsp;a loader<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CrInfo&nbsp;:=&nbsp;Mb.CreateCreateInfo;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.ClassId&nbsp;:=&nbsp;MetabaseObjectClass.KE_CLASS_CUBEMETALOADER;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Id&nbsp;:=&nbsp;</font><font color="#800000">&quot;CUBEMETALOADER&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CrInfo.Permanent&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ObjDesc&nbsp;:=&nbsp;Mb.CreateObject(CrInfo);<br /> &nbsp;&nbsp;&nbsp;&nbsp;Obj&nbsp;:=&nbsp;ObjDesc.Edit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader&nbsp;:=&nbsp;Obj&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;ICubeMetaLoader;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.LoadType&nbsp;:=&nbsp;CubeMetaLoaderLoadType.CreateAndUpdate;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.Rubricator&nbsp;:=&nbsp;Mb.ItemById(</font><font color="#800000">&quot;OBJ_FC&quot;</font><font color="#000000">).Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IRubricator;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.ScaleValues&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoaderBindings&nbsp;:=&nbsp;CubeMetaLoader.Bindings;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Edit&nbsp;calendar&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Calendar;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.CalendarOptions.Levels&nbsp;:=&nbsp;DimCalendarLevelSet.Year;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.ByColumns&nbsp;:=&nbsp;</font><font color="#008080">False</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.CalendarDateFormat&nbsp;:=&nbsp;</font><font color="#800000">&quot;$Year$&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CalendarBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Year&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;CalendarBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Edit&nbsp;the INDICATOR&nbsp;attribute&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;INDICATOR&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Indicator&nbsp;Code&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.Dimension&nbsp;:=&nbsp;Mb.ItemByIdNamespace(</font><font color="#800000">&quot;DICT_IND&quot;</font><font color="#000000">,&nbsp;NsiDescr.Key).Bind<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;«IX_CODE»&nbsp;-&nbsp;unique&nbsp;key&nbsp;of the&nbsp;DICT_IND dictionary<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.Index&nbsp;:=&nbsp;</font><font color="#800000">&quot;IX_CODE&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;IndicatorBinding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;IndicatorBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">2</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;</font><font color="#008000">7</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Edit&nbsp;parameters&nbsp;of the&nbsp;COUNTRY attribute<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CountryBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;COUNTRY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Country&nbsp;Code&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.Dimension&nbsp;:=&nbsp;Mb.ItemByIdNamespace(</font><font color="#800000">&quot;DICT_CTR&quot;</font><font color="#000000">,&nbsp;NsiDescr.Key).Bind&nbsp;</font><font color="#008080">As</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;IX_WEO&nbsp;-&nbsp;dictionary&nbsp;unique&nbsp;key&nbsp;DICT_CTR<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.Index&nbsp;:=&nbsp;</font><font color="#800000">&quot;IX_WEO&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;CountryBinding.NameAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;NAME&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;CountryBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">3</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;</font><font color="#008000">5</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Edit&nbsp;attributes&nbsp;of calendar&nbsp;and&nbsp;measurement&nbsp;units<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;LevelBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LevelBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Attribute;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LevelBinding.Attribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;DL&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LevelBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.ConstValue;<br /> &nbsp;&nbsp;&nbsp;&nbsp;LevelBinding.FieldValue&nbsp;:=&nbsp;DimCalendarLevel.Year&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;Integer;<br /> &nbsp;&nbsp;&nbsp;&nbsp;UnitBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;UnitBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Unit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;UnitBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Units&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;UnitBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;UnitBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Unit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Scale&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.Dimension&nbsp;:=&nbsp;Mb.ItemByIdNamespace(</font><font color="#800000">&quot;UNITS&quot;</font><font color="#000000">,&nbsp;NsiDescr.Key).Bind&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDimensionModel;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;«IX_WEO_UNIT_SCALE»&nbsp;-&nbsp;unique&nbsp;key&nbsp;of the&nbsp;UNITS dictionary<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.Index&nbsp;:=&nbsp;</font><font color="#800000">&quot;IX_WEO_UNIT_SCALE&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ScaleBinding.KeyAttribute&nbsp;:=&nbsp;</font><font color="#800000">&quot;KEY&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;ScaleBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Edit&nbsp;attributes&nbsp;containing&nbsp;values<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;ValueBinding&nbsp;:=&nbsp;CubeMetaLoaderBindings.Add;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ValueBinding.BindingType&nbsp;:=&nbsp;CubeMetaLoaderBindingType.Value;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ValueBinding.Field&nbsp;:=&nbsp;</font><font color="#800000">&quot;Value&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;ValueBinding.FieldType&nbsp;:=&nbsp;CubeMetaLoaderFieldType.Name;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser&nbsp;:=&nbsp;ValueBinding.Parser;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.ParserType&nbsp;:=&nbsp;CubeMetaLoaderParserType.FixedPosition;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionStart&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Parser.StringPositionEnd&nbsp;:=&nbsp;-</font><font color="#008000">1</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;&nbsp;Edit&nbsp;loader&nbsp;parameters<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;Excel&nbsp;:=&nbsp;</font><font color="#008080">New</font><font color="#000000">&nbsp;DtExcelProvider.Create;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.ImexMode&nbsp;:=&nbsp;DtExcelImexMode.Import;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.File&nbsp;:=&nbsp;</font><font color="#800000">&quot;C:\Fixed.xlsx&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.Query&nbsp;:=&nbsp;</font><font color="#800000">&quot;SELECT&nbsp;*&nbsp;FROM&nbsp;[Sheet1$]&quot;</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.HasHeader&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.CheckFieldName&nbsp;:=&nbsp;</font><font color="#008080">True</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Excel.Open;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Provider&nbsp;:=&nbsp;Excel&nbsp;</font><font color="#008080">As</font><font color="#000000">&nbsp;IDatasetDataProvider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008000">//&nbsp;Load<br /> </font><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.Data&nbsp;:=&nbsp;Provider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;TestResult&nbsp;:=&nbsp;CubeMetaLoader.TestLoad;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Count&nbsp;:=&nbsp;TestResult.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Test&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Total&nbsp;errors&nbsp;in&nbsp;log:&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Count.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;Count&nbsp;&gt;&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;i&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">To</font><font color="#000000">&nbsp;Count&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TestResultEntry&nbsp;:=&nbsp;TestResult.Item(i);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(TestResultEntry.Attribute&nbsp;+&nbsp;</font><font color="#800000">&quot;&nbsp;:&nbsp;&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;TestResultEntry.Value&nbsp;+&nbsp;</font><font color="#800000">&quot;&nbsp;=&nbsp;&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;TestResultEntry.Count.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;i&nbsp;&gt;=&nbsp;</font><font color="#008000">10</font><font color="#000000">&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Break</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">For</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Else</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.Data&nbsp;:=&nbsp;Provider;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CubeMetaLoader.LoadData;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log&nbsp;:=&nbsp;CubeMetaLoader.Log;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;</font><font color="#008080">Each</font><font color="#000000">&nbsp;key&nbsp;</font><font color="#008080">In</font><font color="#000000">&nbsp;CubeMetaLoader.InvalidFactors&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Error&nbsp;on&nbsp;loading&nbsp;factor&nbsp;with&nbsp;key:&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;key.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">For</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Count&nbsp;:=&nbsp;Log.Count;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Data&nbsp;loading&quot;</font><font color="#000000">);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(</font><font color="#800000">&quot;Total&nbsp;records&nbsp;in&nbsp;log:&nbsp;&quot;</font><font color="#000000">&nbsp;+&nbsp;Count.ToString);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">For</font><font color="#000000">&nbsp;i&nbsp;:=&nbsp;</font><font color="#008000">0</font><font color="#000000">&nbsp;</font><font color="#008080">To</font><font color="#000000">&nbsp;Count&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Do</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Entry&nbsp;:=&nbsp;Log.Item(i);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Debug.WriteLine(i.ToString&nbsp;+&nbsp;</font><font color="#800000">&quot;&nbsp;:&nbsp;&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.DateBegin.ToString&nbsp;+&nbsp;</font><font color="#800000">&quot;,&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.RecordNumber.ToString&nbsp;+&nbsp;</font><font color="#800000">&quot;,&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.Field&nbsp;+&nbsp;</font><font color="#800000">&quot;,&quot;</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;Entry.ErrorMessage);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">If</font><font color="#000000">&nbsp;i&nbsp;&gt;=&nbsp;</font><font color="#008000">10</font><font color="#000000">&nbsp;-&nbsp;</font><font color="#008000">1</font><font color="#000000">&nbsp;</font><font color="#008080">Then</font><font color="#000000"><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">Break</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">For</font><font color="#000000">;<br /> &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">If</font><font color="#000000">;<br /> </font><font color="#008080">End</font><font color="#000000">&nbsp;</font><font color="#008080">Sub</font><font color="#000000">&nbsp;UserProc;</font>

After executing the example test data loading from the file C:\Fixed.xlsx is executed, the first ten records from report on loading are displayed in the console window. If the test loading is successful, the factors are exported from file to the time series database.

See also:

ICubeMetaLoader