Hi, telerik team,
I drag table control with 3 column to a report and set the NeedDataSource event as:
private void MonthTable_NeedDataSource(object sender, EventArgs e)
{
(sender as Telerik.Reporting.Processing.Table).DataSource = GetDataSource();
}
DataTable GetDataSource()
{
DataTable tablelocal = new DataTable();
tablelocal.Columns.Add("Value", System.Type.GetType("System.Int32"));
tablelocal.Columns.Add("LabelA", System.Type.GetType("System.String"));
tablelocal.Columns.Add("LabelB", System.Type.GetType("System.String"));
tablelocal.Rows.Add(new object[] { 5, "Item 1", "A" });
tablelocal.Rows.Add(new object[] { 4, "Item 2", "B" });
tablelocal.Rows.Add(new object[] { 3, "Item 3", "C" });
tablelocal.Rows.Add(new object[] { 2, "Item 4", "D" });
tablelocal.Rows.Add(new object[] { 1, "Item 5", "E" });
return tablelocal;
}
The generated report is only a empty spreadsheet with 3 column and 5 rows(not include the head).
Do you have any advice so that I can see the real table data in the spreadsheet?
Thanks a lot!
Qixiong
I drag table control with 3 column to a report and set the NeedDataSource event as:
private void MonthTable_NeedDataSource(object sender, EventArgs e)
{
(sender as Telerik.Reporting.Processing.Table).DataSource = GetDataSource();
}
DataTable GetDataSource()
{
DataTable tablelocal = new DataTable();
tablelocal.Columns.Add("Value", System.Type.GetType("System.Int32"));
tablelocal.Columns.Add("LabelA", System.Type.GetType("System.String"));
tablelocal.Columns.Add("LabelB", System.Type.GetType("System.String"));
tablelocal.Rows.Add(new object[] { 5, "Item 1", "A" });
tablelocal.Rows.Add(new object[] { 4, "Item 2", "B" });
tablelocal.Rows.Add(new object[] { 3, "Item 3", "C" });
tablelocal.Rows.Add(new object[] { 2, "Item 4", "D" });
tablelocal.Rows.Add(new object[] { 1, "Item 5", "E" });
return tablelocal;
}
The generated report is only a empty spreadsheet with 3 column and 5 rows(not include the head).
Do you have any advice so that I can see the real table data in the spreadsheet?
Thanks a lot!
Qixiong