In the ActiveReport-ReportStart section of your parent report, you can assign any object type to the Report object variable, ‘UserData’
UserData is a public object of the DataDynamics.ActiveReports.ActiveReport.
Scenario:
Let’s say you are using a Watermark in your parent report. The Watermark is embedded into your parent report at design time. You want to share this Watermark with your sub reports. To do this, store the image of this Watermark in the UserData object. Now it can be accessed by a sub report.
You can write the code in vbscript like this:
Sub ActiveReport_ReportStart rpt.UserData = rpt.Watermark . . . . . . . End Sub
In your sub report, you may want to display the Watermark depending on some condition.
You can access the UserData object that was set in your parent report from your sub report like this:
If "Some Condition" = True Then rpt.ParentReport.Watermark = Nothing Else rpt.ParentReport.Watermark = rpt.ParentReport.UserData End If
If would like to learn how to access controls and their properties on a parent report from a sub report, you can check out my article on the subject here: