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

Use the table as a "Grid"

3 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 10 Apr 2012, 12:40 PM
Hi, 

In one of my report I receive a custom business Object in the constructor, containing all needed data for the report.

I basically set the DataSource to the object I receive in the constructor.

For simple textbox it works quite good, but in my report I'm using a table, not because I receive a list of data that I want to display in a tabular form, but because I've a lot of "Label-> text" to display, two of them per line, and sometimes one line will be to large to stay on one line, so I want that other fields take the same offset.

So here is what I got now: http://screencast.com/t/r7dLQZlTB

All fields which aren't in the table are working good, but I can't make any of the field in the table working.

I tried to set the DataSource of the the table to Fields(through binding), but It doesn't works.

What is my best shot to do this?

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 10 Apr 2012, 12:50 PM
Hi Julien,

The Table item is a separate Data Item similarly to the report itself and it has its own DataSource property that should be set to your custom business object. In case of using Table, you do not need to set the data source for the report, otherwise the Table would be repeated if placed in the detail section.
Setting data source via binding is viable if you're trying to create "master-detail" scenario, which according to your explanation you are not.

Regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Julien
Top achievements
Rank 1
answered on 10 Apr 2012, 12:51 PM
So how should I set the data source?
0
Steve
Telerik team
answered on 10 Apr 2012, 03:50 PM
Hi Julien,

You state in your original post that you use parametrized report constructor which receives the data source and you set the report data source to it e.g.:

this.DataSource = MyCustomObject;

SO setting the data source to the table would be:

this.Table1.DataSource = MyCustomObject;

All the best,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Julien
Top achievements
Rank 1
Answers by
Steve
Telerik team
Julien
Top achievements
Rank 1
Share this question
or