SubReport using recordset

SubReport using recordset

Forum member · Nov 23, 2011
I have a report (Report1) with a SubReport (SubReport1). I need the subreport (SubReport1) to be populated from a query that takes a value from the record in the main report (Report1). I am passing RecordSet from VB.Net code to the report. This is the example to pass the recordset. [Visual Basic] Public Sub CreateRecordSetExample() Dim MyReport As New DocumentLayout(MyFilePath) Dim MyQuery As Query = MyReport.GetQueryById("Query1") AddHandler MyQuery.OpeningRecordSet, AddressOf Query_OpeningRecordSet Dim MyDocument As Document = MyReport.Run() MyDocument.Draw("C:\Temp\report.pdf") End Sub Private Sub Query_OpeningRecordSet(ByVal sender As Object, ByVal e As OpeningRecordSetEventArgs) Dim MyObjectList As New ArrayList() MyObjectList.Add(New CustomObj(1, "One")) MyObjectList.Add(New CustomObj(2, "Two")) MyObjectList.Add(Nothing) MyObjectList.Add(New CustomObj(3, "Three")) MyObjectList.Add(New CustomObj(4, "Four")) args.RecordSet = New EnumerableRecordSet(MyObjectList) End Sub

Re: SubReport using recordset

Support · Nov 23, 2011
Hello, Please send an email to [^a|mailto:support@cete.com|opennewwindow|support@cete.com^] and include the url to this forum post so we can send you the sample code that takes a value from the main reports record set and populates the sub report. Thanks, ceTe Software Support Team.