SaveStyleSheetToXml(pStyleSheet: IStyleSheet): String;
SaveStyleSheetToXml(pStyleSheet: Prognoz.Platform.Interop.Drawing.StyleSheetClass): string;
pStyleSheet. The collection of table formatting styles that should be saved.
The SaveStyleSheetToXml method saves the collection of table formatting styles to the row in the XML format.
To load the collection of table styles from the row in the XML format, use the ITabSheet.LoadStyleSheetFromXml method.
Executing the example requires that the repository contains a regular report with the REG_REPORT_TAB identifier containing connected external styles.
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 regular report
Report := mb.ItemById("REG_REPORT_TAB").Bind As IPrxReport;
// Get collection of table styles
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
Style := Tab.StyleSheet;
// Save collection of table styles into the file in the XML format
StyleXml := Tab.SaveStyleSheetToXml(Style);
XML := New FreeThreadedDOMDocument60.Create;
XML.loadXML(StyleXml);
XML.save("C:\StyleSheet.xml");
End Sub UserProc;
After executing the example the collection of table styles table of available report sheet is unloaded into the C:\StyleSheet.xml file in the XML format.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Drawing;
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: StyleSheetClass;
StyleXml: String;
XML: FreeThreadedDOMDocument60;
Begin
mb := Params.Metabase;
// Get regular report
Report := mb.ItemById["REG_REPORT_TAB"].Bind() As IPrxReport;
// Get collection of table styles
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
Style := Tab.StyleSheet;
// Save collection of table styles into the file in the XML format
StyleXml := Tab.SaveStyleSheetToXml(Style);
XML := New FreeThreadedDOMDocument60.Create();
XML.loadXML(StyleXml);
XML.save("C:\StyleSheet.xml");
End Sub;
See also: