Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continue processing report when sub-report fails

Status
Not open for further replies.

jontvr

IS-IT--Management
Aug 30, 2002
17
US
I'm running this on CE10, but the same issue applies to Crystal Reports designer when the report is run directly.

My report contains 12 identical sub-reports, but each has a different connection string pointing to geographically dispursed databases. The main report itself contains no data other than a heading. My problem is that the entire report fails if one or more of the sub-reports fails to connect to it's database. This can occur due to back-up and maintenance schedules in the different time zones. Is there anyway to get the report to complete and display the data that is was able to gather, and optionally display a status report in place of the missing sub-report(s)?
 
Have the subreport return a value using a shared variable, if it runs OK. Put a section below the section containing the subreport, that says "SUBREPORT FAILED", and is suppressed if the expected value is returned.

To pass data back from a subreport, use a shared variable.
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved
Note that the shared variable is only available in the section after the section which contains the subreport.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thanks, but the core problem is the failure of the whole report if one of the sun-reports fails.
 
I see. Consider converting each sub report to an actual report. Then putting them all in a package. Set the package to not fail when one object fails.

Let me know if that helps!

Bob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top