Using an External Report

Stimulsoft Reports.NET discussion
Post Reply
dpeel2757
Posts: 19
Joined: Fri Feb 29, 2008 6:09 pm

Using an External Report

Post by dpeel2757 »

I'm trying to use the External sub report feature and have looked at the other forum posts, but am having difficulty using it correctly. I have a very limited understanding of VB and c# and have no experience trying to translate one to the other. All the reports I have created so far are in VB and have had a co-worker write some VB functions that we use in the report so looking at the other examples and trying to figure out the correct syntax in c# and translate that to VB has been unsuccessful so far. I have also tired looking at the example reports in the other forums posts about this topic but again have been unsuccessful seeing where the external report event is being called out. Any direction on getting this feature working in a VB report would be greatly appreciated. Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Using an External Report

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

    ...
    Dim report As StiReport = New StiReport()
    report.Load("E:\\Report.mrt")
    AddHandler report.GetSubReport, AddressOf report_GetSubReport
    report.Render()
    report.Show()
    ...

Private Sub report_GetSubReport(ByVal sender As Object, ByVal e As StiGetSubReportEventArgs)
    Dim subReport As StiReport = New StiReport()
    subReport.Load("e:\\Report1.mrt")
    e.Report = subReport
End Sub
Thank you.
Post Reply