ITabCellStyle.LoadFromXml

Syntax

LoadFromXml(Xml: String);

Parameters

Xml. The row in the XML format containing cell style description.

Description

The LoadFromXml method loads cell style from the row in the XML format.

Comments

To save cell style to the row in the XML format, use the ITabCellStyle.SaveToXml method.

Example

Executing the example requires that the repository contains a regular report with the REG_REPORT_TAB identifier. The file system should contain the C:\Style.xml file containing cell style in the XML format.

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

Sub UserProc;
Var
    mb: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Range: ITabRange;
    Style: ITabCellStyle;
    StyleXml: String;
    XML: FreeThreadedDOMDocument60;
Begin
    mb := MetabaseClass.Active;
    // Get cell style from file in the XML format
    XML := New FreeThreadedDOMDocument60.Create;
    XML.load("C:\Style.xml");
    StyleXml := XML.xml;
    // Get regular report
    Report := mb.ItemById("REG_REPORT_TAB").Edit As IPrxReport;
    // Get cell style
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Range := Tab.Cell(00);
    Style := Range.Style;
    // Load obtained style
    Style.LoadFromXml(StyleXml);
    // Save changes
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the first cell style on the available report sheet is loaded from the C:\Style.xml file.

See also:

ITabCellStyle