ITabCellStyle.LoadFromXml

Fore Syntax

LoadFromXml(Xml: String);

Fore.NET 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.

Fore 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.

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;
    Range: ITabRange;
    Style: ITabCellStyle;
    StyleXml: String;
    XML: FreeThreadedDOMDocument60;
Begin
    mb := Params.Metabase;
    // 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;

See also:

ITabCellStyle