External SubReport in Designer

Stimulsoft Reports.NET discussion
Post Reply
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

External SubReport in Designer

Post by Andreas Tastler »

Hi all

Is it possible to show a subreport with UseExternalReport=true in the preview of designer? The event GetSubReport will not be triggered.

Thanks
Andreas
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

External SubReport in Designer

Post by Andreas Tastler »

Sorry folks

I correct this one. Also in designer, the event GetSubReport will be triggered. But I get an error "SubReportPage property is not set". So I have to create an select a dummy subreport, just to get rid of the error in designer.
Why do I need to set SubReportPage when the UseExternalReport is true?

Thanks
Andreas
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

External SubReport in Designer

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

private void bShow_Click(object sender, EventArgs e)       
{
     StiReport report = new StiReport();
     report.Load();
     report.Compile();
     report.CompiledReport.GetSubReport += new StiGetSubReportEventHandler(report_GetSubReport);
     report.Show();
}

void report_GetSubReport(object sender, StiGetSubReportEventArgs e)
{
     StiReport stiSubReport = new StiReport();
     stiSubReport.Load();
     e.Report = stiSubReport;
}
Thank you.
Post Reply