Chart not appearing on report in print preview

juliabird

New member
Local time
Today, 18:34
Joined
Aug 21, 2014
Messages
3
I am having an issue with viewing a report. I have a button set up to show the print preview of the report. There is a chart based on the report's record source, and two sub-reports showing related data. The print preview section however shows the the chart area where it would appear is blank, i.e. there is a white area where the chart should go. There is no error message. The two sub-reports appear correctly. If I go to print the report, however, the chart appears, and it will also appear if I change the view type (e.g. to layout and back again).

I have been searching various forums for someone else with the same issue but with no luck. I think that if I could perhaps build in a "refresh" function to the code behind the button used to call up the report, I might be able to get around this issue. Does anyone have any suggestions here?
 
Try "Compact & Repair".
Only for problem solving:
  • Copy the main report - and take away the 2 subreports, see if it make any difference!

  • Else put a new graph object in the report with same record source, as the other one.
Else you can also try to requery it.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  Me.[B][COLOR=Red]YourGraphName[/COLOR][/B].Requery
End Sub
 
Hi,

The compact and repair option was not successful, as this is something I normally do regularly during application development.

The requery action also did not work.

It seems that the error disappears if I delete the sub-reports. I will see if I can work a solution by playing with the sub-reports. Any pointers here? I don't mind having a look myself at different options, but if you know of anything it would be great as troubleshooting is fairly time-intensive.

Julia
 
..
It seems that the error disappears if I delete the sub-reports. I will see if I can work a solution by playing with the sub-reports. Any pointers here? ..
Then I would start by putting one sub-reports at a time, to see which one cause the "error"!
I know it sound silly, but sometimes, the order your are adding objects to a form/report is not always indifferent.
If you can't get it, then post you database with some sample data, zip it.
 
Are you sure you haven't set the Display When property of the chart or subreport to Print Only?

Did you try JHB's other recommendation?
  • Else put a new graph object in the report with same record source, as the other one.
If none of these work, then upload a sample db as JHB requested.
 
The Display when property is set to "Always" - I already said that the chart displays if I go to report mode and back to print, so this could not have been the problem.

The chart does appear when I delete one particular sub-report. The sub-report is based on the same query as the chart. I am not sure if this is an issue, but when I created a duplicate query to base the sub-report on, just in case Access didn't like creating a chart and displaying data from the same query, I still got the missing chart.

I tried to open the report in ReportView, then add a RunCommand cmAcCmdPrintPreview, to automate refreshing the and it worked the first time, but after that it did not work (I ran the compact/repair action in between). It also did not help if I had the report open first in Print Preview, then used two RunCommands to open in Report View then Print Preview again, which is essentially what I do to get the Print Preview to show the chart.

My work-around is now that I open in Report view, and I have inserted two command buttons that either close the report or print it. So now the report opens with the chart showing, and I have the same functionality as the Print Preview function. The buttons display only on the screen.
 
Okay, you've got a work around!
Then without "hand on" the database, I'm not able from your description, to say what is wrong.
 
Then without "hand on" the database, I'm not able from your description, to say what is wrong.
I second that... and again JHB's suggestion of before (as highlighted) still wasn't tried.
 

Users who are viewing this thread

Back
Top Bottom