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

Attatch data to a report

3 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
garfield
Top achievements
Rank 1
garfield asked on 27 Dec 2007, 08:18 PM

I am trying to create a report with design time support for parameterized queries. Just the same as shown on this video. The problem is that I cannot use the wizzard, nor a SQLDataAdapter. I have a function that given the parameters, returns a dataTable.

I know I can use the following code:

Me.DataSource = dt

But then I lose the design time support as the IDE doesn't know which fields are declared on the dataTable.

Is there any way I can work with a DataAdapter over a middle tier so I can process the data before sending it to the report, declaring the fields I'm going to use so I don't lose the design time support?

Thank you

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 28 Dec 2007, 08:15 AM
Hi garfield,

You can generate a Typed Dataset containing the fields you plan to use and set is as a data source of the report. This will enable design-time support for data fields. Later, at runtime, you can fill the dataset with data.

You can find more about generating Typed DataSets here.

All the best,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
JustinWong
Top achievements
Rank 1
answered on 29 Mar 2008, 01:58 AM
Hi Ross:

Do you have a walkthrough on how to do this?

I'm working on a web project and I already have an xsd file (ReportData.xsd) with a number of DataTables inside it.

Now, I add a new Telerik report 2.0 to the site, and then go to design view.  I look at the datasource property ("none") and click on the down-arrow.  All I see is something called 'project data source.'  When I expand on that, all I see is something called 'NewDataSet.' 

But what I want the report to bind to is a Table called "ClassList" that is inside my ReportData.xsd - which already exists.  How can I achieve this at design time so I can make use of the design interface?

Thanks.
0
Rossen Hristov
Telerik team
answered on 31 Mar 2008, 08:51 AM
Hello JustinWong,

You should set the DataMember property of the Report to be "ClassList". Try that and if problems persist, do not hesitate to contact us again.

By the way, it is best to separate your reports from the rest of the WebSite in a separate ClassLibrary project if possible. For more information on that, please read the Best Practices section.

All the best,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
garfield
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
JustinWong
Top achievements
Rank 1
Share this question
or