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

ReportViewer1.Report.DataSource

2 Answers 203 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Frédéric Martin
Top achievements
Rank 1
Frédéric Martin asked on 13 Jul 2009, 02:59 PM
Hi everyone,

I'm using MS Enterprise Library 4.1 DAAB and I'm trying to set the DataSource for my Report during Runtime in my WebApp.

I had found some old articles referencing

ReportViewer1.Report.DataSource = ...

However this does not seem to work with the latest release of Telerik Reports Q2 2009

Am I missing a reference or are there code examples of setting the DataSource during Runtime for a ReportViewer1.Report in my WebForm ?

Many thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 13 Jul 2009, 04:28 PM
Hello Frédéric,

In Q1 2009 we introduced 2 breaking changes, due to which you would have to either instantiate the report first and use it directly or cast the object returned by the ReportViewer.Report property to Telerik.Reporting.Report type:

Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.reportViewer1.Report; 
report.DataSource = ds;

More info is provided in this KB article: ReportViewer.Report property is now of type Telerik.Reporting.IReportDocument.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Frédéric Martin
Top achievements
Rank 1
answered on 13 Jul 2009, 05:48 PM
Excellent, thank you for the answer, how would I now attach during RunTime a DataSource to a Charting Control or Table placed in a Report, again from a WebForm that contains a ReportViewer in my WebForm.aspx page.

Thanks
Tags
General Discussions
Asked by
Frédéric Martin
Top achievements
Rank 1
Answers by
Steve
Telerik team
Frédéric Martin
Top achievements
Rank 1
Share this question
or