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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport in an Empty Container

Status
Not open for further replies.

kenhamady

Instructor
Sep 10, 2000
8,794
US
Versions 10 and 11, MS Access ODBC using a command. All running on Vista.

I inserted a subreport into a blank container report that has nothing in it but parameter fields (no tables or data fields).
When I preview, the subreport appears empty.
If I click on the subreport it runs - as if it was an "on demand" subreport (which it is not).
If I add a table and a single field to the container, then the subreport runs immediately on preview.
If I delete that field from the container, the subreport vanishes again.

So it appears that a subreport won't run unless there is at least a single record of data in the main report. But I am pretty sure I have seen empty containers that run subreports and I wonder if there is something I have forgotten. Anyone have an idea on this?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Maybe you are thinking of earlier versions. Just tested in 8.5, and you cannot refresh or get to the preview tab when there is no table in the container report, although you can add a sub and it will run in its own window. If you then add a table to the main report, the report can be refreshed and the sub will run. In this version, adding a field to the report is unnecessary--the sub will run just based on a table being added to the report.

-LB
 
I hear you. But one of my colleagues just sent me a version XI report with 3 subreports. The container has no tables or fields (only parameters and formulas that use the parameters). And the subreports show up immediately in preview. I have studied the report and can't see what is different.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top