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

Setting Which Report to Display

3 Answers 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David Copp
Top achievements
Rank 1
David Copp asked on 04 Feb 2010, 02:56 PM
We are looking to convert some Crystal Reports to use telerik.  We have a subweb that displays all our reports based on report display type and what report is to be displayed.

All report requests are directed to the same page which takes a uniqueidentifier id to determine which report to display.  We take our XML report data and convert it to a dataset to be used by the report.datasource.  What I can't figure out is how to specify which report to use.  A previous post said to use the following instead of instead of the IReportDocument syntax.

 

Dim report As Telerik.Reporting.Report = New Report()

 

report.DataSource = myDataSet

ReportViewer1.Report = report

ReportViewer1.DataBind()

So, my question is, how do I specify which report to use?  We have hundreds of reports and would like to stick with our convention of having one aspx page that includes the report viewer.  The included VB.ReportLibrary would then have the report templates.

Thank You for your help

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Feb 2010, 07:43 AM
Hello David Copp,

My colleague in your previous forum thread mentioned that the IReportDocument interface doesn't have a DataSource property, that means if you use it you will have to set the datasource in the Report itself.

Kind regards,
Peter
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
David Copp
Top achievements
Rank 1
answered on 09 Feb 2010, 01:38 PM
I understand that.  My problem is that I need to set the datasource programmatically, so I need to be able to set which report is to be used programmatically.

I have changed my code to be the following:

Dim report As Telerik.Reporting.Report = New Report()

report.DataSource = myDataSet
ReportViewer1.Report = report

ReportViewer1.DataBind()

This is in the page load of the aspx page that has the ReportViewer on it.  Is there a way to programmatically specify which report to display.

0
Peter
Telerik team
answered on 11 Feb 2010, 04:38 PM
Hello David Copp,

You could try to set the DataSource within the Report itself. Check out the articles Adding a Data Source Programmatically and Adding a Data Source through NeedDataSource report event.
 

All the best,
Peter
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
David Copp
Top achievements
Rank 1
Answers by
Peter
Telerik team
David Copp
Top achievements
Rank 1
Share this question
or