method G2antt.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, reference to a string member, 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:

    G2antt1.SaveXML("sample.xml")

  • Reference to a String member - Saves the control's content to the string member. Note that the string member must be empty, before calling the SaveXML method. For example:

    Dim s As String
    G2antt1.SaveXML s

    In VB.NET for /NET assembly, you should call such as :

    Dim s As String = String.Empty
    Exg2antt1.SaveXML(s)

    In C# for /NET assembly, you should call such as :

    string s = string.Empty;
    exg2antt1.SaveXML(ref s);
     

  • XML Document Object. For example:

    Dim xmldoc as Object
    Set xmldoc = CreateObject("MSXML.DOMDocument")
    G2antt1.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, child items or bars. Each item saves a collection of <cell> objects that defines the cell for each column. The <bars> element saves a collection of <bar> each one is associated with the bars in the item. The Expanded attribute specifies whether an item is expanded or collapsed, and it carries the value of the ExpandItem property. The <chart> element saves data related to the chart data of the control. For instance, it includes the collection of levels being displayed in the chart, the first visible date, links and groups of bars. The <levels> element holds a collection of <level> objects each one being associated with an level in the chart area. The <links> element holds a collection of <link> objects each one indicating a link between two bars in the chart. The <groups> element holds a collection of <group> objects that indicates the bars that are grouped in the chart.

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>
		- <Groups>
			  <Group ItemA KeyA StartA ItemB KeyB StartB /> 
			  <Group ItemA KeyA StartA ItemB KeyB StartB /> 
			  ...
		  </Groups>
	  </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>
The following C# sample saves the control's data to testing.xml file:
object xml = "c:\\testing.xml";
axG2antt1.SaveXML(ref xml);

The following VB.NET sample saves the control's data to testing.xml file:

Dim xml As String = "testing.xml"
AxG2antt1.SaveXML(xml)