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:
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???