Using ms graph 97 chart embedded in report, problems.

P

Peter Row

Hi,

I'm using an MS Graph 97 Chart control on a report, 3 in fact.
One for a bar chart and 2 for pie charts.

In each case I use the row source property to set the data for each chart.

The date is a list of regions along with a count of two pieces of data for
each region.
My data will look (field names changed) something like this:

Region Data 1 Data 2
NW 10 53
SE 12 6

So for the bar chart I show on the X axis the region and for each region
there are
two bars one for data 1 and one for data 2.

On the pie charts I show region/data1 and region/data2 respectively.

When I open the control on the report and enter some example data and
configure
it to have the labels etc... they way I want it looks fine in design view.

However when I run the report it looks totally wrong.
For example the bar chart only shows one region (when in the data returned
by the query
there are 2) and the legends are not what I entered.

In the pie charts it just shows one region with 100% of the data. Again
wrong since there
are two regions in the data returned by the query.

Anybody have any ideas as to how to debug this or have any clue as to what
is wrong?

Regards,
Peter
 
S

SA

Peter:

This may simply be a known issue with MS Graph properly "refreshing" the
data before it draws the chart. Stop by our web and look in the code and
design tips area, on the main tips and you'll find some code there you can
add to your report to force this refresh before the chart is drawn.
 
P

Peter Row

Hi,

Thanks, that seems to of done the trick.

However I wonder if you have ever come across the following:
Whenever I insert a chart via the insert menu in Access XP (2002) SP2 and
select the pie chart type Access
crashes when I click finish. If I repeat exactly the same steps except but
pick a bar/column chart it works fine.

Regards,
Peter
 
P

Peter Row

Hi,

Got around the crash issue by placing an unbound ole control on the report
and then
setting that to a pie chart.

However now, even after using the refresh, application.update code from your
site the pie
chart is not showing all the data.

See included example data in original message below. It seems to be only
displaying
the last record.

Regards,
Peter
 
P

Peter Row

Hi,

Further to this, if I clear the graphs spreadsheet part and then let the
refresh code from your site fill it back in
I see something a bit weird.

All the data IS being filled in, however on the spreadsheet part of the
control for a pie chart where it usually puts a quarter
of a pie symbol next to each value it doesn't do this for the first row of
data, in fact the first row of day does not have a
number next to it. The second row is labelled 1.

Regards,
Peter
 
P

Peter Row

Hi,

Phew - this is so god-damned stupid but I have finally found a way to make
the chart show what I want
(using the refresh code from SA's website) without crashing.

To do it I had to (inconjunction with the refresh code) insert chart from
the insert menu. Follow all the steps
EXCEPT when asked for a title DO NOT change the default value it puts in,
click finish and all works according
to plan. I then just changed the title once it was on my report. If you
change it in the wizard Access crashes.

I had to use the wizard because using a ole unbound control with the ms
graph 97 wouldn't show the data correctly
even with the code from the website. Said code is still needed however even
if you use the wizard.

Regards,
Peter
 
S

SA

Peter:

Missed all the previous portions of your unfortunate machinations to get
this to work but glad that you did. Thanks for the info in general, we look
at where we can incorporate your experience in our advice.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top