PutRow(Values: Array);
Values. Loaded row in a one-dimensional array.
The PutRow method loads a row into the data consumer.
To load all the data array rows, use the IDtCustomConsumer.Put method.
Executing the example requires a module with the CUSTOM_EXPORT identifier containing the MyDtCustomConsumer class. Add links to the Metabase, Dt, Dal system assemblies.
Sub UserProc_PutRow;
Var
MB: IMetabase;
Consumer: IDtUserConsumerEx;
Fields: IDtFieldDefinitions;
Field: IDtFieldDefinition;
v: Array;
Begin
MB := MetabaseClass.Active;
//Array of exported values
v := New Variant[3];
v[0] := "Buckwheat"; v[1] := 10; v[2] := 313.12;
Consumer := New DtUserConsumerEx.Create;
Consumer.Metabase := MB;
Consumer.Module := MB.ItemById("CUSTOM_EXPORT");
Consumer.Macro := "MyDtCustomConsumer";
Fields := Consumer.Fields;
Field := Fields.Add;
Field.DataType := DbDataType.String;
Field.Name := "Name";
Field := Fields.Add;
Field.DataType := DbDataType.Integer;
Field.Name := "Identifier";
Field := Fields.Add;
Field.DataType := DbDataType.Float;
Field.Name := "Value";
Consumer.Open;
Consumer.Clear;
Consumer.PutRow(v);
Debug.WriteLine("Number of written rows: " + Consumer.WritingRowsCount.ToString);
Consumer.Close;
End Sub UserProc_PutRow;
After executing the example data row is loaded into the consumer using custom algorithm.
See also: