This is a migrated thread and some comments may be shown as answers.

Help..Binding Datatable to Telerik Table control

1 Answer 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Frank Corrado
Top achievements
Rank 1
Frank Corrado asked on 09 Oct 2009, 03:37 PM
Help...

I'm a newbie at Telerik reporting. I am having a hard time getting this down for my project.

I have a datatable with say 5 rows of data.

I am then binding that datatable to the table. When I do this, it creates a new page in the report for each row of data. I would like 5 rows of data in one page

etc...

Row 1 = 'FirstName' 'LastName'
Row 2 = 'FirstName2' 'LastName2'

However, what it's doing is putting Row 2 on another page. Any help?

Here is my code...

rpt.DataSource = datatable;

ReportViewer1.Report = rpt;

On actual report. I just have a table control and FirstName and LastName in 2 separate columns.

 

 

ReportViewer1.DataBind()

 

1 Answer, 1 is accepted

Sort by
0
Scott Niskanen
Top achievements
Rank 1
answered on 16 Oct 2009, 05:11 PM
Hello,

I am also new to the reporting, however, I will try to help.

if your table is named "rpt" then

rpt.datasource = yourdatasource;

then in the report designer in each column put in

=Fields.TheFieldYouWantToDisplay
ex.
=Fields.FirstName    for column 1

The table adds a row for each item in the datasource.
You may not need:

ReportViewer1.Report = rpt;

ReportViewer1.DataBind() ;


I hope this helps and sorry if it doesn't.
Tags
General Discussions
Asked by
Frank Corrado
Top achievements
Rank 1
Answers by
Scott Niskanen
Top achievements
Rank 1
Share this question
or