Thanushka
Thanushka

Reputation: 1445

c# Crystal Report add sub report to a section

I need to add a sub report to a section dynamically. Is there a way of doing it?

Thanks in advance.

Upvotes: 2

Views: 1913

Answers (1)

floele
floele

Reputation: 3788

If you have a ReportDocument object, you can use the ReportClientDocument-API to add a new subreport like this (example for page footer):

report.ReportClientDocument.SubreportController.ImportSubreportEx("Test", @"C:\test-sub.rpt", report.ReportClientDocument.ReportDefController.ReportDefinition.PageFooterArea.Sections[0], left, top, width, height);

Upvotes: 2

Related Questions