SubReport using recordset

Skip Navigation LinksHome  /  Support  /  Forums  /  FireMail for .NET (v1)  /  Re: SubReport using recordset

FireMail for .NET (v1) Forum

 Nov 23 2011 11:17 AM

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

 Nov 23 2011 4:58 PM
Posted by a ceTe Software moderator
Hello,

Please send an email to 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.

All times are US Eastern Standard time. The time now is 8:40 AM.