Page 1 of 1

External SubReport in Designer

Posted: Fri Oct 29, 2010 7:23 am
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

External SubReport in Designer

Posted: Fri Oct 29, 2010 7:28 am
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

External SubReport in Designer

Posted: Fri Oct 29, 2010 8:34 am
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.