I'm getting the following error when binding my XML data to the SmartChartPro .NET Control
Code:An error occurred while loading the ItemTemplate controls. Please ensure that the ItemTemplate contains well-formed HTML. Please ensure that you closed all of the tags and used proper casing. Error: An error occurred while parsing EntityName. Line 5, position 30.
Here is an exerpt from my XML document
Code:<?xml version="1.0" encoding="utf-8" ?>
<NewDataSet>
<Table>
<name>Chris Hillsman</name>
<title>Mgr Corp Treasury</title>
<id>DADFAAE5-2978-4919-BA13-9CC500C5B180</id>
<pid>0650AA2E-20D7-4B11-A4DD-9CC500C5D191</pid>
</Table>
<Table>
<name>Berry Mansfield</name>
<title>Mgr Financl Plng & Anlys</title>
<id>05E2D965-7E2D-40CE-8441-9CC500C5B1C3</id>
<pid>0650AA2E-20D7-4B11-A4DD-9CC500C5D191</pid>
</Table>
<Table>
<name>Justine Nicholis</name>
<title>Mgr Mfg Finance</title>
<id>CFCFD043-D082-4128-B8EF-9CC500C5B1DA</id>
<pid>0650AA2E-20D7-4B11-A4DD-9CC500C5D191</pid>
</Table>
<Table>
<name>Alvin Tolentino</name>
<title>Asst Controller</title>
<id>9B53FF2F-0467-4725-92E2-9CC500C5B1F2</id>
<pid>0650AA2E-20D7-4B11-A4DD-9CC500C5D191</pid>
</Table>
<Table>
<name>Bill Forbes</name>
<title>Mgr Inventory/Cost Acctng</title>
<id>E8575518-7608-40A9-9EE9-9CC500C5B20A</id>
<pid>05E2D965-7E2D-40CE-8441-9CC500C5B1C3</pid>
</Table>
</NewDataSet>
Here is the code I'm using to generate my chart
Code:
<swc:SmartChartPro ID="SmartChart1" Title="MCFA Corp Org Chart" runat="server" OutputType="Html"
AllowDrillDown="True" DataTitleFields="name" Font-Size="8" MaxTextLength="30"
Width="900px" Height="300px" DataNodeName="Employee" DataKeyField="id" DataFields="id, name,title"
BoxColor="Gainsboro" BoxGradient="True" ChartDepth="2" ImageWidth="50" ImageHeight="62"
ImageField="image" Font-Bold="false" MaxChildrenPerLevelGroup="5" HasParentImagePath="~/SampleCode/SmartChartLite/Images/BlueUp.gif"
HasParentImageVSpace="0" HasChildrenImagePath="~/SampleCode/SmartChartLite/Images/BlueDown.gif"
HasChildrenImageVSpace="-1" DrillDownType="SmartChartItem" FitToWidth="true" >
<ItemTemplate>
<div>
<div><%# Container.DataItem["name"] %></div>
<div><%# Container.DataItem["title"] %></div>
</div>
</ItemTemplate>
</swc:SmartChartPro>
C#
Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var ds = GetDataSource();
SmartChart1.DataSource = ds;
SmartChart1.DataBind();
}
}
private DataSet GetDataSource()
{
var ds = new DataSet();
var request = WebRequest.Create("url to org chart data") as HttpWebRequest;
using (var response = request.GetResponse() as HttpWebResponse)
{
// Load data into a dataset
ds.ReadXml(response.GetResponseStream());
}
ds.Tables[0].TableName = "Employee";
DataColumn colParent = ds.Tables[0].Columns["id"];
DataColumn colChild = ds.Tables[0].Columns["pid"];
var relation = new DataRelation("ParentChildRel", colParent, colChild);
relation.Nested = true;
ds.Relations.Add(relation);
return ds;
}
I can read in the data just fine and print any of the fields from the xml document, with the exception of the title. Am I doing something wrong? I'm very stumped as to what might be wrong
TIA