Hello Anne-Marie
Yuo will have to set the dasource for both the main report and the subreport. For the subreport you could obtain a SubreportObject through the ReportObjects collection. The following example shows you how to iterate through the sections of a report and change the background color of each subreport to magenta.
Dim Report As New CrystalReport1
Dim subReport As SubreportObject
Dim sect As Section
Dim rptObject As Object
For Each sect In Report.Sections
For Each rptObject In sect.ReportObjects
If rptObject.Kind = crSubreportObject Then
Set subReport = rptObject
subReport.BackColor = RGB(255, 0, 255) '''****replace with your pointer to the DS
Set subReport = Nothing
End If
Next
Next
- Ludek