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

no main report data means subreport is not executed 1

Status
Not open for further replies.

beckybear

Programmer
May 28, 2002
23
0
0
US
I have a main report with a single subreport. The subreport is placed in the report footer. The main report is linked to the subreport by start date and end date parameters (entered by the user for the main report and passed to the subreport). The main and subreport use the same tables, but different search criteria.

This report is working just fine when there is data for both reports.

There could be times when there is data for the main report, but not the subreport, and vice versa. My problem is that when there is no data for the main report, the subreport is not executed (the border's not even printed). When I run the subreport separately and manually enter the date parameters, I get the correct results.

In trying to solve this, I've tried recreating the subreport. I also created a very simple subreport with only the two date links and no criteria on the table. This report did not return any results. I changed my very simple subreport not to link to the main report and then it did execute properly.

Is there something I do to make this linked subreport execute no matter what the main report results are, since they are only linked by parameters?
 
Place both of your reports as subreports within a container report that will always return data (use some SQL that assures data, like a select from a reference table, but not too much because of the performance hit).

Place each subreport in a separate report footer.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top