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

need an example on passing a collection or dataset to a report

3 Answers 203 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pete Haberstroh
Top achievements
Rank 1
Pete Haberstroh asked on 17 Apr 2009, 05:31 PM
I have a asp page running, the user selects to print the details of a certain route, how would I set up the report viewer and telerik report to show the report.

currently the program builds a collection of the information, but I am not sure how to pass that into the report viewer, could someone give me a little example on how this would work.

my setup now is I have an ASP page has the report viewer in it, in that page I am gathering the data needed for the collection, I have a myReport in the class library that the reportviewer is linked to
or does the data collection need to be done in the report class ?

I am trying to follow the examples in the telerik reporting manual, but the example they provide shows how to connect to a database.

thanks



 

3 Answers, 1 is accepted

Sort by
0
Sekar
Top achievements
Rank 1
answered on 17 Apr 2009, 07:05 PM
Hi Pete
 You can easily assign your business object datasource in the Report class constructor 
public partial class MyReport : Telerik.Reporting.Report 
    { 
        public MyReport() 
        { 
            /// <summary> 
            /// Required for telerik Reporting designer support 
            /// </summary> 
            InitializeComponent(); 
            this.DataSource = getDataSource(); // this method assigns the data prepared from the business 

Let me know if this helps, otherwise provide more detail to understand your issue.

Thanks
Sekar Ram
0
Pete Haberstroh
Top achievements
Rank 1
answered on 17 Apr 2009, 07:11 PM

that part I believe I have down, how would I pass a parameter into the report to build my datasource

 

for example from the web page I select a truck and want the details of that truck to show up in the report ?

thanks for your help

0
Sekar
Top achievements
Rank 1
answered on 17 Apr 2009, 08:04 PM
Pete
  To my understanding if you pass input driven datasource, you can do dynamic reporting datasource assignment. check this post
In that post, the dynamic report is created everytime and assigned the datasource then the report is assinged to ReportViewerObj.Report.  You can apply your input parameter and prepare the datasource and do dynamic reporting this way. 

May be this helps

Regards
Sekar Ram
Tags
General Discussions
Asked by
Pete Haberstroh
Top achievements
Rank 1
Answers by
Sekar
Top achievements
Rank 1
Pete Haberstroh
Top achievements
Rank 1
Share this question
or