none
How to associate a report viewer data region (Table) with a data source programmitically RRS feed

  • Question

  • I have a report that uses the same business objects list for its report viewer tables.  when ever i run this report it winds up putting the same data in the different tables.  So, I assume i must associate the table with the source data.  My tables are named RushingPlays and Passing Plays.  My data list is called sl and I copy below what i think should be the way to accomplish this but, as described above the association is not done.  Would appreciate some guidance on how to do this.  It must be a basic simple process and I must be overlooking something.  Thanks for you help.

    By the way this is for a project that I am doing for our local High School football program and I am a volunteer new to VS2010 and c#.

                        // report stats for this play type
                        Microsoft.Reporting.WinForms.ReportDataSource rptBind;
                        this.StatsOSBindingSource.DataSource = sl;
                        
     
                        switch (i)
                        {
                            case (int)Play.PTypes.Rush:
                                rptBind = new ReportDataSource("RushingPlays", StatsOSBindingSource);
                                this.reportViewer1.LocalReport.DataSources.Add(rptBind);
                                break;
                            case (int)Play.PTypes.Pass:
                                rptBind = new ReportDataSource("PassingPlays", StatsOSBindingSource);
                                this.reportViewer1.LocalReport.DataSources.Add(rptBind);
                                break;
    Wednesday, December 14, 2011 6:55 AM