Registering DataTable with child Tables in code
Hi all,
I'm trying to use multiple Data Tables in a single MSChart. To do this I made a parent DataTable to contain all my other tables:
from ReportTemplate.frx: <TableDataSource Name="AllData" ReferenceName="AllData" DataType="System.Int32" Enabled="true"> <TableDataSource Name="A" ReferenceName="AllData.A" DataType="System.Int32" Enabled="true"> <Column Name="X" DataType="System.Double"/> <Column Name="Y" DataType="System.Double"/> </TableDataSource> <TableDataSource Name="B" ReferenceName="AllData.B" DataType="System.Int32" Enabled="true"> <Column Name="X" DataType="System.Double"/> <Column Name="Y" DataType="System.Double"/> </TableDataSource> </TableDataSource>
When I register Data non-hierachical Data, I do it as follows:
//... DataSet dataSet = new DataSet(); DataTable dataA = new DataTable(); DataTable dataB = new DataTable(); dataA.TableName = "A"; dataB.TableName = "B"; DataTable[] dataArray = new DataTable[]{ dataA, dataB, }; foreach (var table in dataArray) { table.Columns.Add("X", typeof(double)); table.Columns.Add("Y", typeof(double)); } dataSet.Tables.AddRange(dataArray); // Add rows to the tables containing the desired data //... report.RegisterData(dataSet, "DataSet"); //...
How can I register the table "AllData" that contains "A" and "B"?