IDtObject.Save

Syntax

Save(Element: IXMLDOMElement);

Parameters

Element. XML element, in which data source consumer parameters are saved.

Description

The Save method saves data source or data consumer parameters in XML format.

Comments

To download data source or consumer parameters from XML format, use the IDtObject.Load method.

Example

Executing the example requires a module with the CUSTOM_LOAD identifier, containing the MyDtCustomProvider class. Add links to the Metabase, Dt, Xml system assemblies.

Sub Save;
Var
    MB: IMetabase;
    UsProv: IDtUserProviderEx;
    Doc: FreeThreadedDOMDocument60;
    Element: IXmlDomElement;
Begin
    MB := MetabaseClass.Active;
    UsProv := 
New DtUserProviderEx.Create;
    UsProv.Metabase := MB;
    UsProv.Module := MB.ItemById(
"CUSTOM_IMPORT");
    UsProv.Macro := 
"MyDtCustomProvider";
    UsProv.Open;
    Doc := 
New FreeThreadedDOMDocument60.Create;
    Element := Doc.createElement(
"UserProvider");
    UsProv.Save(Element);
    Doc.appendChild(Element);
    Doc.save(
"D:\UserProvider.xml");
    UsProv.Close;
End Sub Save;

After executing the example, parameters of the created user data consumer are loaded to the C:\UserProvider.xml XML file.

See also:

IDtObject