Thanks RaisKazi
Problem is solved.
Please find the solution steps with code and if there is any idea to make it is or more meaningful please suggest me. Below code is working for me.
1. Drag a blank table on report first.
2. Code behind:-
private void ReportTry_NeedDataSource(object sender, EventArgs e)
{
dbCon = new SqlConnection(ConfigurationManager.ConnectionStrings["abc"].ConnectionString);
dbCon.Open();
dbCon.Close();
SqlDataAdapter adapter = new SqlDataAdapter("spOrder", dbCon);
DataTable dt = new DataTable();
adapter.Fill(dt);
table1.DataSource = dt;
Telerik.Reporting.HtmlTextBox textboxGroup;
Telerik.Reporting.HtmlTextBox textBoxTable;
table1.ColumnGroups.Clear();
table1.Body.Columns.Clear();
table1.Body.Rows.Clear();
int ColCount = dt.Columns.Count;
for (int i = 0; i <= ColCount -1; i++)
{
Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
table1.ColumnGroups.Add(tableGroupColumn);
textboxGroup = new Telerik.Reporting.HtmlTextBox();
textboxGroup.Style.BorderColor.Default = Color.Black;
textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
textboxGroup.Value = dt.Columns[i].ColumnName;
textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
tableGroupColumn.ReportItem = textboxGroup;
textBoxTable = new Telerik.Reporting.HtmlTextBox();
textBoxTable.Value = "=Fields." + dt.Columns[i].ColumnName;
textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
table1.Body.SetCellContent(0, i, textBoxTable);
table1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
}
}
Thanks and Reagdrs!
Kuldeep Dwivedi