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

Bind DataTable to Telerik Report Table

3 Answers 731 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 11 Jun 2011, 12:13 AM
Hi,

I am trying to integrate the WPF Report Viewer into a WPF application.

I would like to:

1.  Generate a "DataTable" object in code at runtime, with a varying amount of rows and columns.

2.  View this datatable in a Telerik Report.

I've been having some difficulty and am beginning to question if this is possible.

Is it?

Thank you,
Justin

3 Answers, 1 is accepted

Sort by
0
IvanDT
Telerik team
answered on 13 Jun 2011, 05:07 PM
Hello Justin,

Why do you need to generate tables dynamically? Is the data that you need to populate in this table dynamically generated or is it retrieved from a database? The whole time you talk about DataTable,
so we're confused.

Generally there is rarely need to generate Telerik Reporting Table item dynamically and in most cases the Table and CrossTab Wizards can help you achieve the desired layout in the report designer. To bind your data to the Table item, you can use the ObjectDataSource or SqlDataSource components.

Concerning your second question you can check our documentation for more info:
Best wishes,
IvanDT
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Justin
Top achievements
Rank 1
answered on 13 Jun 2011, 05:19 PM
Hi, thank you for the response.

The DataTable Im referring to is "System.Data.DataTable".  (Business Objects)

Ive placed one into a objectDataSource and would like to know if it is possible to set the System.Data.DataTable (or other alternative) as the only binding to a table in the reporting engine?  This would permit me to structure the DataTable dynamically in procedural code.

I have already accomplished this goal using a crosstab and DataPoints, its just a little hairy.  (Which I admit is likely due to lack of experience on my part using this solution)

Thanks again,
Justin
0
IvanDT
Telerik team
answered on 14 Jun 2011, 05:22 PM
Hello Justin,

It is possible to bind a Telerik Report or a Table item to DataTable object directly, but in this way you would not have a Design time support as it requires a data schema. For more information refer to the following HowTo article.

After doing so, you can structure programmatically the DataTable however you like. The only thing is that there will be no Designer support but nevertheless the report should be working in runtime.

Regards,
IvanDT
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Justin
Top achievements
Rank 1
Answers by
IvanDT
Telerik team
Justin
Top achievements
Rank 1
Share this question
or