method Grid.SaveXML (Destination as Variant)
Saves the control's content as XML document to the specified location, using the MSXML parser.

 TypeDescription 
   Destination as Variant This object can represent a file name, an XML document object, or a custom object that supports persistence as follows:
  • String - Specifies the file name. Note that this must be a file name, rather than a URL. The file is created if necessary and the contents are entirely replaced with the contents of the saved document. For example:

    Grid1.SaveXML("sample.xml")

  • XML Document Object. For example:

    Dim xmldoc as Object
    Set xmldoc = CreateObject("MSXML.DOMDocument")
    Grid1.SaveXML(xmldoc)

  • Custom object supporting persistence - Any other custom COM object that supports QueryInterface for IStream, IPersistStream, or IPersistStreamInit can also be provided here and the document will be saved accordingly. In the IStream case, the IStream::Write method will be called as it saves the document; in the IPersistStream case, IPersistStream::Load will be called with an IStream that supports the Read, Seek, and Stat methods.

 
 ReturnDescription 
  BooleanA Boolen expression that specifies whether saving the XML document was ok. 
The SaveXML method uses the MSXML ( MSXML.DOMDocument, XML DOM Document ) parser to save the control's data in XML documents. The LoadXML method loads XML documents being created with SaveXML method. The SaveXML method saves each column in <column> elements under the <columns> collection. Properties like Caption, HTMLCaption, Image, Visible, LevelKey, DisplayFilterButton, DisplayFilterPattern, FilterType, Width and Position are saved for each column in the control. The <items> xml element saves a collection of <item> objects. Each <item> object holds information about an item in the control, including its cells or child items. Each item saves a collection of <cell> objects that defines the cell for each column. The Expanded attribute specifies whether an item is expanded or collapsed, and it carries the value of the ExpandItem property. 

The control saves the control's data in XML format  like follows:

- <Content Author Component Version ...>
	- <Chart FirstVisibleDate ...>
		- <Levels>
			  <Level Label Unit Count /> 
			  <Level Label Unit Count /> 
			  ...
		  </Levels>
		- <Links>
			  <Link Key StartItem StartBar EndItem EndBar Visible StartPos EndPos Color Style Width ShowDir Text ... /> 
			  <Link Key StartItem StartBar EndItem EndBar Visible StartPos EndPos Color Style Width ShowDir Text ... /> 
			  ...
		  </Links>
	  </Chart>
	- <Columns>
		  <Column Caption Position Width HTMLCaption LevelKey DisplayFilterButton DisplayFilterPatter FilterType ... /> 
		  <Column Caption Position Width HTMLCaption LevelKey DisplayFilterButton DisplayFilterPatter FilterType ... /> 
		  ...
	  </Columns>
	- <Items>
		- <Item Expanded ...>
			  <Cell Value ValueFormat Images Image ... /> 
			  <Cell Value ValueFormat Images Image ... /> 
			  ...
			- <Bars>
				  <Bar Name Start End Caption HAlignCaption VAlignCaption Key ... /> 
				  <Bar Name Start End Caption HAlignCaption VAlignCaption Key ... /> 
				  ...
			  </Bars>
			- <Items>
			   - <Item Expanded ...>
			   - <Item Expanded ...>
			   ....
			  </Items>
		  </Item>
	  </Items>
  </Content>


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.