Thanks, Rick Pace.
4 Answers, 1 is accepted
It seems that you have used a data item (subreport, table, list or crosstab) in the report's detail section. However the data items are a separate data regions and they not make use of the report's data source. They have their own DataSource property which you have set in order to populate the item with data. However if you have in addition set the Report.DataSource property. The report engine will create a detail section with the data item for every row of your datasource. To avoid this behavior our suggestion is to set the Report.DataSource property to none or move the table item to another non repeating section such as report header or unbound group header (group without grouping).
Greetings,Peter
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

I am using table in the report header section.
The column names are populating properly. but the 1st column data is displayed in all other columns.
Below is the code that iam using,
private
void
DReport3_NeedDataSource(
object
sender, EventArgs e)
{
DataSet ds =
new
DataSet();
string
strsqlconn = ConfigurationManager.ConnectionStrings[
"Myconn"
].ConnectionString;
SqlConnection sqlConnection1 =
new
SqlConnection(strsqlconn);
SqlCommand cmd =
new
SqlCommand();
SqlDataAdapter DA =
new
SqlDataAdapter();
cmd.CommandText =
"SELECT * FROM user"
;
cmd.CommandType = CommandType.Text;
cmd.Connection = sqlConnection1;
DA.SelectCommand = cmd;
sqlConnection1.Open();
DA.Fill(ds);
(sender
as
Telerik.Reporting.Processing.Report).DataSource = ds;
table1.DataSource = ds.Tables[0];
Telerik.Reporting.HtmlTextBox textboxGroup;
Telerik.Reporting.HtmlTextBox textBoxTable;
table1.ColumnGroups.Clear();
table1.Body.Columns.Clear();
table1.Body.Rows.Clear();
int
ColCount = ds.Tables[0].Columns.Count;
for
(
int
i = 0; i <= ColCount - 1; i++)
{
Telerik.Reporting.TableGroup tableGroupColumn =
new
Telerik.Reporting.TableGroup();
table1.ColumnGroups.Add(tableGroupColumn);
//table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
textboxGroup =
new
Telerik.Reporting.HtmlTextBox();
textboxGroup.Style.BorderColor.Default = Color.Black;
textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
textboxGroup.Value = ds.Tables[0].Columns[i].ColumnName;
textboxGroup.Size =
new
SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
tableGroupColumn.ReportItem = textboxGroup;
textBoxTable =
new
Telerik.Reporting.HtmlTextBox();
//textBoxTable.Style.BorderColor.Default = Color.Black;
//textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
textBoxTable.Value =
"=Fields."
+ ds.Tables[0].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,
Manognya.K
This behavior can be observed when the TableGroups' names are not unique and the same name is set by default for each group. To avoid this you should explicitly set a unique name for each TableGroup group that you add e.g.:
tableGroupColumn.Name =
"TableGroup"
+ i.ToString();
where i is unique in the scope of the table.
Regards,
Nasko
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
