How to add pages from one report to another

Stimulsoft Reports.NET discussion
Post Reply
mdavidson
Posts: 4
Joined: Thu May 21, 2009 10:27 am
Location: USA

How to add pages from one report to another

Post by mdavidson »

I need to add pages from one report to another, And I tried the code

Dim mReport As New StiReport
mReport.Load("Reports0.mrt")

Dim oReport As New StiReport
oReport.Load("Reports1.mrt")

For Each aPage As StiPage In oReport.Pages
mReport.Pages.Add(aPage)
Next
mReport.show

This causes an error
System.NullReferenceException
{"Object reference not set to an instance of an object."}

Is there a way to copy a page from one report to another?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to add pages from one report to another

Post by Jan »

Hello,

You need fill Report property with new report. For example:

Code: Select all

aPage.Report = mReport

Thank you.
Post Reply