Subreports not printing, but show up fine in Report View

EricM

Registered User.
Local time
Yesterday, 19:00
Joined
Oct 7, 2008
Messages
11
I am having problems with a report that I have created in Access 2007. The report uses several tables linked with an SQL server as a data source, and contains several subreports. When I view the report in Report View, all of the data in the subreports shows up fine, but when I view it in Print Preview, all of the subreports show up blank (the entire area of the subreport is blank, nothing shows up), and when I print the report the subreports are still missing. Any ideas why this is occurring and how I can fix it?

Thanks in advance
-Eric
 
In the main report, could you have have set the Visible property of the sub report to No?

Or do you have anything else in that region of the main report that could be interfering, any other controls etc?

And when you view the subreports alone, are they each on just one page? Not that i know whether that should make any difference, but I'm clutching at straws!!)
 
Thanks for your advice, Big Pat.

For all the subreports, Visible is set to Yes, Display is set to Always. I don't see any controls on the main report that might be interfering, and there are 4 subreports, so I'd think that at least one of them would be free from interference if it was just a matter of control overlap (though I won't completely rule it out - it just appears that nothing is overlapping).

I'm not sure what you mean by the subreports showing up on one page, but if I open up the subreports in a seperate window and go to print preview, they show up fitting on the same page size and orientation as the main report.

One thing I did notice - when I open the main report in Report View, it often takes a second or two for the subreport data to populate, which leads me to the following hypothesis:
When printed, the report refreshes the data, and the data for the subreports doesn't get populated quickly enough. Access thinks the subreports don't have data, so it doesn't print them.

The hypothesis is entirely a wild guess, but it would explain what was going on - is there a way to ensure that data is populated in the subreports before printing, or force Access to print blank subreports?

Thanks
-Eric
 
Your hypothesis could well be correct, but I'm afraid my expertise isn't up to knowing how you could check that or work round if it is indeed an issue. You might need to ask your question again, though maybe this reply will bump you near the top again and one of the Gods on this site will drop in.

My question about page layout was whether your entire report, including subreports, all fits on one page. Or does it go to multiple pages?

In case it helps at all, I have attached a screenshot of a report design of mine which also uses four subreports. It was a bit of trial and error to get it how I wanted it, but it works fine. I'm just wondering whether the size of each individual report 'control' on your main report has any effect.

This is the same report I'm having a different problem with,

Just a thought: have you set the "Can Grow" property to Yes for your subreports?
 

Attachments

In my report, each item form the main report takes up about a page and a half, with three of the subreports on the first page, but judging by the labels I have above each subreport, they're not spanning pages - each one takes up a small amount of space on the page its on, but isn't trying to bleed over to the next page.

Yes, the CanGrow property is set to yes for each subreport, but I've tried it with all combinations of CanGrow and CanShrink being on and off and haven't seen any difference.

-Eric
 
Eric did you find a solution?
I am having the same problem today, but in Access 2003. The problem started when I added one more subreport to the end of my report. Now, several of my subreports DO print and several others, in addition to an image in the header, do NOT even though everything shows up find in print preview. Very strange.
 
Unfortunately no solution yet. One thing you may try in your case is to remove that last subreport that seems to have caused the issue, and replace it with a copy of one of your other subreports - that should at least tell you if the issue is the number of subreports or the settings of those reports.

Good luck
-Eric
 
That is what I thought - I removed the last subreport that I had added, and commented out all the code that applies to it, but still, some of the other subreports and the image in the header are blank when printing. I went and checked for MS updates too, in case this is a known issue, but my system is all up to date and I still have the problem.
 
Copy and save the main Report and then add the subReports back to the new one
 
Nope, still comes out blank, but it was a good thought. The weird thing is that the two subreports that print out blank print out fine by themselves, it is just when they are on the main report that they won't print.
 
Check in code if there are actually records being returned in the subreports.

Or remove the original subreports and keep the problematic subreport and print it out- see if it persists.
 
One of the Reports is almost certainly corrupted, trial and error by the sounds of it, how are the subs linked to the main;)
 
Records must be being returned - cause they show up on the print preview, just not on the actual print out. I tried removing just the two that aren't printing out, and the rest prints out fine with or without those two on there. I haven't tried removing everything else and just leaving the two problem ones, but it can't hurt to try.
 
One of the Reports is almost certainly corrupted, trial and error by the sounds of it, how are the subs linked to the main;)

If they were corrupted, wouldn't they fail to print on their own?

They are both linked though link master/link child fields, but different ones. They are both in the group footer of the report - don't know if there are issues with subreports in group footers or not.
 
The trouble with corruption is that they take many faces.

One more thing to investigate is removing the links and manually input the criteria for the subreport. See if it clears up.
 
There is a limit to the number of subforms on a form, don't know if the same applies to subreports, how many are linked by the same field and how many by the other?
 
The trouble with corruption is that they take many faces.

One more thing to investigate is removing the links and manually input the criteria for the subreport. See if it clears up.

Yep, I have tried that too, but no luck.
 
There is a limit to the number of subforms on a form, don't know if the same applies to subreports, how many are linked by the same field and how many by the other?


There are a total of 6 subreports, one of which has a few layers of subreports (that's not the one that is causing problems though).

There are 3 linked to one field, 2 linked to another, and 1 linked to another.

Doesn't seem like too many, but I don't know what the limits are.
 
Which group of links does the problematic one belong to?
 
A random idea- what happens if it's not in group footer? (e.g. in another section)

As for limits, I could be wrong, but I heard the limit was 7 *nested* subforms/subreports with no limits to sibling subforms/subreports.
 

Users who are viewing this thread

Back
Top Bottom