1
votes

I have a vb.net solution that is developped using vs 2010 and .net framework 4.0.

On a submit button reports are generated using Crystal Reports version 13.0.2. Reports are filled with datasets and some of them are nested reports. Suppose I have report A, with sub-report B and B contains a sub-report C. I am using the below code to fill data:

MainReport.Load(Server.MapPath("~\Reports\A.rpt"))
MainReport.OpenSubreport("B.rpt").SetDataSource(DsB)
MainReport.OpenSubreport("B.rpt").OpenSubreport("C.rpt").SetDataSource(DsC)

But the third line is throwing an error

Not supported within subreports.

What is the error here? Any suggestions?

Please note that I am not using parameters in subreports.

2

2 Answers

0
votes

Nested subreports are not supported in Crystal Reports. This is by design.

See also the following discussions:
https://archive.sap.com/discussions/thread/3348939
https://archive.sap.com/discussions/thread/2142327
http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=193

You'll need to re-design your report(s).

0
votes

MatSnow precisely made clear what is the error.

As a suggestion, the workaround i usually do is to combine groups and details sections.

I cannot say t is always possible, but the main idea would be to use a group section to show the data of A, use the details section to show the data of B, and use a subreport to show the data of C.

Of course, if your current subreports contains groups, you will have to create more groups.

Another advantage of this approach is because subreports are slow. But it is a problem only for large reports.