Showing results for 
Search instead for 
Did you mean: 

Looping over subreports

0 Kudos

I am using VS 2019 and Crystal Reports SP31. I am trying to set the logon information for several subreports.

I have statement that loops over the subreports as follows:

Dim sbr As CrystalDecisions.CrystalReports.Engine.ReportDocument

For Each sbr In crpt.Subreports

crpt is a Crystal Reports document with subreports.

When the second statement is executed, the system is very very slow to complete. Up to a minute. What could cause this issue?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Norm,

Code is not very helpful.

Here it is in C#:

if (_ReportDocument.Subreports.Count > 0)
   for (int k = 0; k < _ReportDocument.Subreports.Count; k++)
        foreach (ISCRTable CrTableOld in _ReportDocument.ReportClientDocument.SubreportController.GetSubreportDatabase(_ReportDocument.Subreports[k].Name).Tables)
0 Kudos

Thanks. That worked for me. I don't understand why the statement 'For Each sbr In crpt.Subreports' caused an issue, but your solution worked.

Answers (0)