Hello.
I need your help please. first my development conditions are limited. i can't use the Design tap just use program code. bcs does not work a sqlDataSource tool in Telerik. to connect a DB server only use our cust command. retrun type is a DataTable when use cust command.
so i found tip and succeeded by reference this code.
------------------------------------------------------------------------------------------------------------
private void table1_NeedDataSource(object sender, EventArgs e)
{
//HttpContext context = HttpContext.Current; // If you need the table from Session
//DataTable dt = (DataTable)context.Session["data"];
DataTable dt2 = new DataTable();
dt2.Clear();
dt2.TableName = "name table 2";
dt2.Columns.Add("column1");
dt2.Columns.Add("column2");
DataRow _rowAdd = dt2.NewRow();
_rowAdd["column1"] = "11";
_rowAdd["column2"] = "55";
dt2.Rows.Add(_rowAdd);
_rowAdd = dt2.NewRow();
_rowAdd["column1"] = "22";
_rowAdd["column2"] = "33";
dt2.Rows.Add(_rowAdd);
_rowAdd = dt2.NewRow();
_rowAdd["column1"] = "aa";
_rowAdd["column2"] = "bb";
dt2.Rows.Add(_rowAdd);
//if you need to rename the columns:
//for (int k = 0; k < dt.Columns.Count; k++)
//{
// dt.Columns[k].ColumnName = dt.Columns[k].ColumnName.ToLower().Replace("|", "").Replace(" ", "").Replace("\", "");
//}
table1.DataSource = dt2;
Telerik.Reporting.HtmlTextBox textboxGroup;
Telerik.Reporting.HtmlTextBox textBoxTable;
table1.ColumnGroups.Clear();
table1.Body.Columns.Clear();
table1.Body.Rows.Clear();
int ColCount = dt2.Columns.Count;
for (int i = 0; i <= ColCount -1; i++)
{
Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
table1.ColumnGroups.Add(tableGroupColumn);
tableGroupColumn.Name = i.ToString(); //very important this "Name" because of a Telerik bug is needed
textboxGroup = new Telerik.Reporting.HtmlTextBox();
textboxGroup.Style.BorderColor.Default = Color.Black;
textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
textboxGroup.Value = dt2.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." + dt2.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 });
}
}
------------------------------------------------------------------------------------------------------------
When i have succeeded up to screen is 'now.png' file and what I want here is a SEQNO cell merge. like 'want.png'
And return table is dynamic. often change a rows of a SEQNO and SUBNO column.
i found cell merge tip in this fourm. but other tips used a Design tap or not dynamic table.
I could not find to code it. so i need help.
Thank you.