PutRow(Values: Array);
PutRow(Values: System.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_cPutRow;
Var
Consumer: IDtUserConsumerEx;
Fields: IDtFieldDefinitions;
Field: IDtFieldDefinition;
v: Array;
Begin
//Array of exported values
v := New Variant[3];
v[0] := "Buckwheat"; v[1] := 10; v[2] := 313.12;
Consumer := New DtUserConsumerEx.Create;
Consumer.Metabase := MetabaseClass.Active;
Consumer.ImplClass := "CUSTOM_EXPORT.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_cPutRow;
After executing the example data row is loaded into the consumer using custom algorithm.
Executing the example requires a .NET assembly with the CUSTOM_EXPORT_NET identifier containing the MyDtCustomConsumer class.
Imports Prognoz.Platform.Interop.Dt;
Imports Prognoz.Platform.Interop.Dal;
…
[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
Consumer: IDtUserConsumerEx;
Fields: IDtFieldDefinitions;
Field: IDtFieldDefinition;
v: Array;
Begin
//Array of exported values
v := New object[3];
v[0] := "Buckwheat"; v[1] := 10; v[2] := 313.12;
Consumer := New DtUserConsumerEx.Create();
Consumer.Metabase := Params.Metabase;
Consumer.ImplClass := "CUSTOM_EXPORT_NET.MyDtCustomConsumer";
Fields := Consumer.Fields;
Field := Fields.Add();
Field.DataType := DbDataType.ddtString;
Field.Name := "Name";
Field := Fields.Add();
Field.DataType := DbDataType.ddtInteger;
Field.Name := "Identifier";
Field := Fields.Add();
Field.DataType := DbDataType.ddtFloat;
Field.Name := "Value";
Consumer.Open();
Consumer.Clear();
Consumer.PutRow(v);
System.Diagnostics.Debug.WriteLine("Number of written rows: " + Consumer.WritingRowsCount().ToString());
Consumer.Close();
End Sub;
After executing the example data row is loaded into the consumer using custom algorithm.
See also: