The XmlDataSource control allows you to connect your PivotView to an XML data file by specifying paths to a custom schema (*.schema) file, an XML (*.xml) data file, and, optionally, a transformation (*.xsl or *.xslt) file. There is a Windows version and a Web version included, and the appropriate one shows up in your Visual Studio toolbox depending on the type of form you have open.
When you drag the control from the toolbox onto your Windows form or WebForm, it appears in a tray below the form. You can select the control in the tray to set its properties in the Properties grid, or you can set its properties in the code view of the form.
Here are the properties that you can use to set up the data source without using any code.
Property | Description |
---|---|
AutoConnect | If you specify this data source in the PivotView control's DataSource property, setting this property to True connects the PivotView to the data source and loads the schema view (with Attributes and Measures lists, etc.) automatically. |
CustomSchemaFile | In this property, you can click the ellipsis button to open the Open File dialog and navigate to your *.schema file. Sample schema can be found in: C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\DataSources\Factbook\LifeExpectancyByGdpAndLiteracy.schema |
DataFile | In this property, you can click the ellipsis button to open the Open File dialog and navigate to your *.xml file. Sample data can be found in: C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\DataSources\Factbook\Factbook.xml |
QueryString | Enter a valid XPath query string, for example: //country |
TransformationFile | You can optionally specify a transformation (*.xsl or *.xslt) file. A sample transformation can be found in: C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\DataSources\Factbook\LifeExpectancyByGdpAndLiteracy.xsl |
For more information about using this control, see How To: Connect to Data Sources.