LoadSettingsFromXml(Element: IXmlDomElement);
LoadSettingsFromXml(Element: Prognoz.Platform.Interop.MsXml2.IXmlDomElement);
Element. Object in the XML format, from which express report parameters are loaded.
The LoadSettingsFromXml method loads express report parameters from the XML document.
To load express report parameters in XML, use the IEaxAnalyzer.SaveSettingsToXml method.
Executing the example requires that the repository contains an express report with the OLAP identifier. The file system must contain the C:\OlapSettings.xml file containing express report parameters in the XML format.
Add links to the Express, Metabase and Xml system assemblies.
Sub UserLoadFromXML;
Var
mb: Imetabase;
Eax: IEaxAnalyzer;
XmlDoc: IXmlDomDocument3;
el: IXmlDomElement;
Begin
mb := MetabaseClass.Active;
// Get XML document
XmlDoc := New FreeThreadedDOMDocument60.Create;
XmlDoc.load("C:\OlapSettings.xml");
el := XmlDoc.selectSingleNode("Root") As IXmlDomElement;
// Get express report
Eax := mb.ItemById("OLAP").Edit As IEaxAnalyzer;
// Load express report settings from XML document
Eax.LoadSettingsFromXml(el);
// Save express report
(Eax As IMetabaseObject).Save;
End Sub UserLoadFromXML;
Example execution result: expres report parameters are loaded from the C:\OlapSettings.xml file.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.MsXml2;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: Imetabase;
Eax: IEaxAnalyzer;
XmlDoc: IXmlDomDocument3;
el: IXmlDomElement;
Begin
mb := Params.Metabase;
// Get XML document
XmlDoc := New FreeThreadedDOMDocument60.Create();
XmlDoc.load("C:\OlapSettings.xml");
el := XmlDoc.selectSingleNode("Root") As IXmlDomElement;
// Get express report
Eax := mb.ItemById["OLAP"].Edit() As IEaxAnalyzer;
// Load express report settings from XML document
Eax.LoadSettingsFromXml(el);
// Save express report
(Eax As IMetabaseObject).Save();
End Sub;
See also: