method Pivot.LoadXML (Source as Variant, [Flags as Variant])
Loads an XML document from the specified location, using MSXML parser.

TypeDescription
Source as Variant An indicator of the object that specifies the source for the XML document. The object can represent a file name, a URL, an IStream, a SAFEARRAY, or an IXMLDOMDocument
Flags as Variant Specifies a numeric expression that defines which parts of the XML file should be ignored when loading data. Multiple flags can be combined using bitwise OR (|). 

The flags you can use are (numeric value only) :

  • exXMLIgnoreDateFormat (0x0001, 1), Ignores the file's DateFormat setting. Defined by <DateFormat> tag.
  • exXMLIgnoreTimeFormat (0x0002, 2), Ignores the file's TimeFormat setting. Defined by <TimeFormat> tag.
  • exXMLIgnoreNumberFormat (0x0004, 4), Ignores the file's NumberFormat setting. Defined by <NumberFormat> tag.
  • exXMLIgnoreColumns (0x0008, 8), Ignores columns definitions. Defined by <Columns> tag.
  • exXMLIgnoreItems (0x0010, 16), Ignores items settings. Defined by <Items> tag.

For example, LoadXML(..., 7) loads the data but ignores the file's DateFormat, TimeFormat, and NumberFormat. You can use this approach when saving the file locally, as the date, time, and number formats will remain unchanged.

ReturnDescription
BooleanA boolean expression that specifies whether the XML document is loaded without errors. If an error occurs, the method retrieves a description of the error occurred.
The LoadXML method uses the MSXML ( MSXML.DOMDocument, XML DOM Document ) parser to load XML documents, previously saved using the SaveXML method. The control is emptied when the LoadXML method is called, and so the columns and items collection are emptied before loading the XML document. The DataColumns property accesses the control's Columns collection, so you can rename or specify the column's type once the control's data is loaded. The PivotColumnsFloatBarVisible property specifies whether the Columns collection is displayed to a floating bar, so user can drag and drop columns to the control's pivot bar so it gets data summarized. The ClearData method clears the control's data. Use the DisplayPivotData property to specify the number of rows to be displayed on the control's list.

The control can load data using one of the following methods:

The AppendData method appends data to the control (prevents clearing data already loaded).

The following properties may be used to group and summarize the data, once it is loaded:

The XML format looks like follows:

- <Content Author Component Version ...>
- <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 ... /> 
      ...
    - <Items>
        - <Item Expanded ...>
        - <Item Expanded ...>
        ....
      </Items>
    </Item>
  </Items>
</Content>