IDimSelection.ExternalSave

Syntax

ExternalSave: String;

ExternalSave(): string;

Description

The ExternalSave method saves selection in the XML format to the string.

Comments

It is used together with the IDimSelection.ExternalLoad method.

Fore Example

Executing the example requires a form, the UiDimension component with the UiDimension1 identifier, and the DimensionTree component with the DimensionTree1 identifier. The data source of DimensionTree1 is UiDimension1. A dictionary with the DIC_CAL_SL identifier located in the repository is connected to the UiDimension1 component.

Add a link to the XML(MsXml2 for Fore.NET example).

The example is a handler of the OnCreate event for the form.

Sub IDIMSELECTION_SELECTLEVEL_OnCreate(Sender: Object; Args: IEventArgs);
Var
    XMLS: string;
    XML: FreeThreadedDOMDocument60;
Begin
    // Add all dictionary elements to selection
    DimensionTree1.Selection.SelectAll;
    // Save selection in the XML format to the string
    XMLS := DimensionTree1.Selection.ExternalSave;
    // Save selection to an XML file
    XML := New FreeThreadedDOMDocument60.Create;
    XML.loadXML(XMLS);
    XML.save("c:\File.xml");
End Sub IDIMSELECTION_SELECTLEVEL_OnCreate;

Imports Prognoz.Platform.Interop.MsXml2;

Private Sub IDIMSELECTION_SELECTLEVEL_FORM_NETForm_Activated(sender: System.Object; e: System.EventArgs);
Var
    XMLS: string;
    XML: FreeThreadedDOMDocument60;
Begin
    // Add all dictionary elements to selection
    DimensionTreeNet1.Selection.SelectAll();
    // Save selection in the XML format to the string
    XMLS := DimensionTreeNet1.Selection.ExternalSave();
    // Save selection to an XML file
    XML := New FreeThreadedDOMDocument60.Create();
    XML.loadXML(XMLS);
    XML.save("c:\File.xml");
End Sub;

After executing the example the selection will be saved into the file C:\File.xml.

See also:

IDimSelection