SaveTo(Element: Variant);
Element. Object, to which sorting parameters will be saved as XML code.
The SaveTo method saves parameters of attributes values' sorting as XML code.
Use the IRdsSortAttributes.LoadFrom method to load sorting parameters from XML.
Executing the example requires that the repository contains an MDM dictionary with the D_EXP_IMP identifier that contain import schemes.
Add links to the Metabase, Rds, and Xml system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
dictObj: IMetabaseObject;
Dict: IRdsDictionary;
sExport: IMetaRdsExportSchema;
dictSort: IRdsSortAttributes;
Doc: IXmlDomDocument;
Element: IXmlDomElement;
Begin
Mb := MetabaseClass.Active;
// Get MDM dictionary
dictObj := Mb.ItemById("D_EXP_IMP").Bind;
Dict := dictObj As IRdsDictionary;
// Get the first export scheme
sExport := Dict.ExportSchemas.Item(0) As IMetaRdsExportSchema;
// Get sorting parameters
dictSort := sExport.SortAttributes;
// Save parameters to file
Doc := New DOMDocument.Create;
Element := Doc.createElement("SortAtt");
dictSort.SaveTo(Element);
Doc.appendChild(Element);
Doc.save("C:\SortAtt.xml");
End Sub UserProc;
After executing the example attribute sorting parameters in the first export scheme are saved to the file C:\SortAtt.xml.
See also: