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

Problem with 2 subreports

2 Answers 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 10 Mar 2011, 04:35 PM
I have a report where I am including 2 subreports into the detail section of the parent report.  The problem is that when running the parent report everything works up until the 2nd subreport is processed.  For some reason subreport 2 is retaining the datasource for the subreport 1. When the detail section is processed for subreport 2 if throws exception because the dataset is for the first subreport.
Here is the method:
In Sub New of the parent report I set the 2 supreports report source:
Dim subRpt1 As ReportServer.subrptContacts = New ReportServer.subrptContacts
srContacts.ReportSource = subRpt1
Dim subRpt2 As ReportServer.subrptCFR = New ReportServer.subrptCFR
srCFRs.ReportSource = subRpt2

 

 

sqlContacts.ConnectionString = strConn
sqlContacts.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
sqlContacts.SelectCommand = "get_contacts"
sqlContacts.Parameters.Add("@p_activity_id")
sqlContacts.Parameters("@p_activity_id").Value = USER2
Me.DataSource = sqlContacts

 

 

subRpt2:

sqlCFRs.ConnectionString = strConn
sqlCFRs.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
sqlCFRs.SelectCommand = "get_cfrs"
sqlCFRs.Parameters.Add("@p_activity_id")
sqlCFRs.Parameters("@p_activity_id").Value = USER2
Me.DataSource = sqlCFRs

 Why is the second subreport not using the dataset I am assigning???

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 15 Mar 2011, 05:45 PM
Hello Robert,

Please upgrade to the latest official release Q3 Service Pack 1 that addresses this issue that slipped in Q3 2010 related to the SubReport items.

Give it a try and if you still experience any issues we will appreciate if you send us a sample report that exhibits the issue to debug locally.

All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Robert
Top achievements
Rank 1
answered on 15 Mar 2011, 07:45 PM
Excellent!  Thanks
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Peter
Telerik team
Robert
Top achievements
Rank 1
Share this question
or