ITabSheet.LoadStyleSheetFromXml

Syntax

LoadStyleSheetFromXml(pStyleSheet: IStyleSheet, Xml: String);

Parameters

pStyleSheet. Collection of table formatting styles that should be loaded.

Xml. The row in the XML format containing description of the collection of table styles.

Description

The LoadStyleSheetFromXml method loads the collection of table styles from the row in the XML format.

Comments

To save table styles to the row in the XML format, use the ITabSheet.SaveStyleSheetToXml method.

Example

Executing the example requires that the repository contains a regular report with the REG_REPORT_TAB identifier containing connected external styles. The file system must contain the C:\StyleSheet.xml file containing table styles in the XML format.

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

Sub UserProc;
Var
    mb: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Style: IStyleSheet;
    StyleXml: String;
    XML: FreeThreadedDOMDocument60;
Begin
    mb := MetabaseClass.Active;
    // Get collection of table styles from file in the XML format
    XML := New FreeThreadedDOMDocument60.Create;
    XML.load("C:\StyleSheet.xml");
    StyleXml := XML.xml;
    // Get regular report
    Report := mb.ItemById("REG_REPORT_TAB").Edit As IPrxReport;
    // Get collection of table styles
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Style := (Tab.StyleSheet As IMetabaseObject).Edit As IStyleSheet;
    // Load obtained styles
    Tab.LoadStyleSheetFromXml(Style, StyleXml);
    // Save changes
    (Report As IMetabaseObject).Save;
    (Style As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the collection of table styles for the available report sheet is loaded from the C:\TableStyles.xml file.

See also:

ITabSheet