• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1163
  • Last Modified:

Crystal Reports: Passing Parameters to SubReports > Report goes into infinite loop

Crystal Reports: Passing Parameters to SubReports > Report goes into infinite loop and keeps spewing the same data over and over until I hit the stop icon.  

Report > Select Expert > Record

Main Report:
{INVOICE.INV_DATE} in {?ReportStartDate} to {?ReportEndDate}

Each of three SubReports:
{INVOICE.INV_DATE} in {?Pm-?ReportStartDate} to {?Pm-?ReportEndDate}
Each SubReport contains the exact same statement.

If I run the Subs separately, I get one copy of each set of data. Perfect.

If I run the Main Report, I get into the loop where I get infinite copies of each SubReport, page after page. Not perfect.  

Any clue as to how I'm getting into this loop?  Or more importantly, how I can eliminate the looping?  Image of Edit > Subreports Links...dialog box
1 Solution
Where do you have the subreports?

Are you expecting 1 run of each subreport for the entire report?
If so they should be in the report header or the report footer.

If you need 1 run for each record (detail section) then you should link on something that identifies the detail record in addition to the date range

Similarly if you have groups.  You can put it in the group header or footer and link it on the group field

cgettelAuthor Commented:
I moved the subs to the footer. That gave me 70 blank pages then a single copy of each subreport.

I suppressed  the details. And now the report is perfect.

Many thanks mlmcc!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now