CustomObject: Variant;
Property is to be read-only.
The CustomObject property returns the object, that is the data source, obtained with help of custom algorithm.
Data provider is available after the IDtObject.Open method activation only.
Executing the example requires a module with the CUSTOM_LOAD identifier containing the MyDtCustomProvider class. Add links to the Metabase, Dt system assemblies.
Sub UserProc_CustomObject;
Var
MB: IMetabase;
UsProv: IDtUserProviderEx;
CustProv: IDtCustomProvider;
Values: Array;
ReadingRows: Integer;
Begin
MB := MetabaseClass.Active;
UsProv := New DtUserProviderEx.Create;
UsProv.Metabase := MB;
UsProv.Module := MB.ItemById("CUSTOM_LOAD");
UsProv.Macro := "MyDtCustomProvider";
UsProv.Open;
UsProv.FieldsFromFile;
CustProv := UsProv.CustomObject As IDtCustomProvider;
If CustProv.ImplementFetchRows Then
CustProv.FetchRows(10, Values);
Else
While Not CustProv.Eof Do
CustProv.Fetch(Values);
End While;
End If;
ReadingRows := CustProv.ReadingRowsCount;
Debug.WriteLine("Read " + ReadingRows.ToString + " rows");
UsProv.Close;
End Sub UserProc_CustomObject;
Result of the example execution: there will be an attempt to load strings from data consumer, that was obtained using a custom algorithm, in the Values array using custom algorithm. In the console window the number of actual loaded strings will be shown.
See also: