ICalendarSetup.SaveToXml

Syntax

SaveToXml(Element: Variant);

Parameters

Element. Object to which calendar parameters are saved as XML code.

Description

The SaveToXml method loads calendar parameters to XML code.

Comments

Use the ICalendarSetup.LoadFromXml method to upload parameters from XML code.

Example

Executing the example requires calendar dictionary with the CALENDARSETUP identifier. Add links to the Dimensions, Metabase and Xml system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Calendar: ICalendarDimension;
    CalendDimInst: IDimInstance;
    DynamicCalendInst: IDynamicCalendarInstance;
    Setup: ICalendarSetup;
    Node: IXmlDomElement;
    DestXML: FreeThreadedDOMDocument60;
Begin
    mb := MetabaseClass.Active;
    Calendar := mb.ItemById("CALENDARSETUP").Bind As ICalendarDimension;
    CalendDimInst := Calendar.OpenAs(CalendarOpenType.Flat);
    DynamicCalendInst := CalendDimInst As IDynamicCalendarInstance;
    Setup := DynamicCalendInst.NewSetup;
    DestXML := New FreeThreadedDOMDocument60.Create;
    Node := DestXML.createElement("Root");
    DestXML.appendChild(Node);
    Setup.SaveToXml(Node);
    DestXML.save("C:\CalendarSetup.xml");
End Sub UserProc;

After executing the example default settings of the CALENDARSETUP dictionary are saved to the XML document C:\CalendarSetup.xml.

See also:

ICalendarSetup