ITabTableStyles.SaveToXml

Fore Syntax

SaveToXml: String;

Fore.NET Syntax

SaveToXml(): string;

Description

The SaveToXml method saves table formatting styles to the row in the XML format.

Comments

To load table formatting styles from the row in the XML format, use the ITabTableStyles.LoadFromXml method.

Fore Example

Executing the example requires that the repository contains a regular report with the REG_REPORT_TAB identifier containing table styles.

Add links to the Metabase, Report, Tab, Xml system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Style: ITabTableStyles;
    StyleXml: String;
    XML: FreeThreadedDOMDocument60;
Begin
    mb := MetabaseClass.Active;
    // Get regular report
    Report := mb.ItemById("REG_REPORT_TAB").Bind As IPrxReport;
    // Get table styles
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Style := Tab.TableStyles;
    // Save table styles to file in the XML format
    StyleXml := Style.SaveToXml;
    XML := New FreeThreadedDOMDocument60.Create;
    XML.loadXML(StyleXml);
    XML.save("C:\TableStyles.xml");
End Sub UserProc;

After executing the example table styles from the available report sheet are unloaded to the C:\TableStyles.xml file in the XML format.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.MsXml2;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Style: ITabTableStyles;
    StyleXml: String;
    XML: FreeThreadedDOMDocument60;
Begin
    mb := Params.Metabase;
    // Get regular report
    Report := mb.ItemById["REG_REPORT_TAB"].Bind() As IPrxReport;
    // Get table styles
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Style := Tab.TableStyles;
    // Save table styles to file in the XML format
    StyleXml := Style.SaveToXml();
    XML := New FreeThreadedDOMDocument60.Create();
    XML.loadXML(StyleXml);
    XML.save("C:\TableStyles.xml");
End Sub;

See also:

ITabTableStyles