473,400 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Changing graph axis min max on report

Hi

I have a report with a graph on it and want to change the minimum and
maximum values for the value axis when it is previewed. This can't be done
by adding code in the Open event as once the report has started printing the
properties can't be changed.

It can be done with an MDB by opening it in design mode hidden, making the
change, saving it and then opening it in preview mode. However, this
obviously doesn't work in an MDE which is how this is distributed.

If I leave it on Auto the graph does not always set the minimum and maximum
to sensible values, and sometimes the 4 series are all bunched together and
unreadable.

Does any one have any ideas?

Jeff
Nov 12 '05 #1
3 4558
Jeff wrote:
Hi

I have a report with a graph on it and want to change the minimum and
maximum values for the value axis when it is previewed. This can't be
done by adding code in the Open event as once the report has started
printing the properties can't be changed.
Why not use a Form instead?
It can be done with an MDB by opening it in design mode hidden,
making the change, saving it and then opening it in preview mode.
However, this obviously doesn't work in an MDE which is how this is
distributed.

If I leave it on Auto the graph does not always set the minimum and
maximum to sensible values, and sometimes the 4 series are all
bunched together and unreadable.
Make sure all your settings are correct....
Does any one have any ideas?

Jeff


You can set the value in code on the OnFormat property I think. You
would need to reference the MSGraph object if you want to use the Graph
object in code.

I've done a lot with MSGraph via code so if you need more info I'll try
and dig up an example.

ps. Another suggestion: I store the graph object in a table and display
it on a report that way
--
regards,

Bradley
Nov 12 '05 #2
Well rip my knickers and kick my a... Putting the code in the On Format for
the report works, but it doesn't in the On Open. In On Open it says the
properties can't be changed once printing has started!!!! But it works in
the On Format??? I assumed On Format wouldn't work...shouldn't assume.

The values only need to be set once for the report, which is why I chose the
On Open event.

Thanks Bradley. That problem is solved.

Here is another. This same graph is on a form. On the form users enter a
couple of parameters and press a button to process data for the graph. Last
thing before requerying the graph it changes axis min and max values.

The problem is, open the form, enter params and press button to calc and
display query and min max don't change from last time the form was used.
Leave params as are and press button again, running same code again, and it
works, and continues to work there after. Close the form and reopen it and
same problem again.

When the form is opened, the first time doesn't change the setting. I have
stepped through code and it sets the values but the graph min max doesn't
change, other then displaying the data correctly.

Jeff

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message
news:_p******************@news-server.bigpond.net.au...
Jeff wrote:
Hi

I have a report with a graph on it and want to change the minimum and
maximum values for the value axis when it is previewed. This can't be
done by adding code in the Open event as once the report has started
printing the properties can't be changed.


Why not use a Form instead?
It can be done with an MDB by opening it in design mode hidden,
making the change, saving it and then opening it in preview mode.
However, this obviously doesn't work in an MDE which is how this is
distributed.

If I leave it on Auto the graph does not always set the minimum and
maximum to sensible values, and sometimes the 4 series are all
bunched together and unreadable.


Make sure all your settings are correct....
Does any one have any ideas?

Jeff


You can set the value in code on the OnFormat property I think. You
would need to reference the MSGraph object if you want to use the Graph
object in code.

I've done a lot with MSGraph via code so if you need more info I'll try
and dig up an example.

ps. Another suggestion: I store the graph object in a table and display
it on a report that way
--
regards,

Bradley

Nov 12 '05 #3
Jeff wrote:
Well rip my knickers and kick my a... Putting the code in the On
Format for the report works, but it doesn't in the On Open. In On
Open it says the properties can't be changed once printing has
started!!!! But it works in the On Format??? I assumed On Format
wouldn't work...shouldn't assume.
Good idea :) If you think about it it does make sense though.
The values only need to be set once for the report, which is why I
chose the On Open event.

Thanks Bradley. That problem is solved.
Great, that was simple enough:)
Here is another. This same graph is on a form. On the form users
enter a couple of parameters and press a button to process data for
the graph. Last thing before requerying the graph it changes axis min
and max values.

The problem is, open the form, enter params and press button to calc
and display query and min max don't change from last time the form
was used. Leave params as are and press button again, running same
code again, and it works, and continues to work there after. Close
the form and reopen it and same problem again.

When the form is opened, the first time doesn't change the setting. I
have stepped through code and it sets the values but the graph min
max doesn't change, other then displaying the data correctly.

Jeff
I'm just trying to think of some "tricks" I had to do when I was working
with Graph....

(1) Before changing any properties try moving the focus to the Graph
object (even try moving focus back afterwards?)

eg. Code that update the data behind my graph

Me.Refresh
ExtractChart Me![ChartID], False 'function that gets data
Me.Refresh
Me![MyGraph].SetFocus
SetDatasheet Me![MyGraph], Me![ChartID], True 'function that put
data on datasheet
Me![MyGraph].SetFocus 'seems to be needed to force chart to refresh

(2) Don't assign values from a form to a graph property directly, assign
to a variable first

(3) Another oddity, "MyGraph.Datasheet.Cells.ClearContents" doesn't work
properly in A97 but does in A2000 (it clears the contents but does not
reset the chart's range). In A97 I had to delete the cells in the
datasheet but that cleared all my series settings.

Hope that helps.

Bradley

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message
news:_p******************@news-server.bigpond.net.au...
Jeff wrote:
Hi

I have a report with a graph on it and want to change the minimum
and maximum values for the value axis when it is previewed. This
can't be done by adding code in the Open event as once the report
has started printing the properties can't be changed.


Why not use a Form instead?
It can be done with an MDB by opening it in design mode hidden,
making the change, saving it and then opening it in preview mode.
However, this obviously doesn't work in an MDE which is how this is
distributed.

If I leave it on Auto the graph does not always set the minimum and
maximum to sensible values, and sometimes the 4 series are all
bunched together and unreadable.


Make sure all your settings are correct....
Does any one have any ideas?

Jeff


You can set the value in code on the OnFormat property I think. You
would need to reference the MSGraph object if you want to use the
Graph object in code.

I've done a lot with MSGraph via code so if you need more info I'll
try and dig up an example.

ps. Another suggestion: I store the graph object in a table and
display it on a report that way
--
regards,

Bradley


--
regards,

Bradley
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff | last post by:
Hi I am manipulating MS Graph and can successfully change the minimum and maximum values for the Y axis, but can't find a way of doing this for the X axis. This works for Y axis...
2
by: borekfm | last post by:
Hitting two problems when running a new report I've created, that contains a chart/graph. The chart shows three series, two are shown as lines and one as an area. The data come from three different...
2
by: savas_karaduman | last post by:
I supposed that creating graph with access would be as easy as how I could with Excel. But it seems to me that there is some tricky point here. What i am trying to do and what i got is as follow: ...
2
by: smith.mariya | last post by:
hi, i am mariya. i am working on vb.net. i have created the powerpoint addin. i have inserted the chart on the slide through vb.net code. now, i want to remove the gridlines on the chart and want...
3
by: ConfusedMay | last post by:
Hi, I need to create a graph report that showed total hours and unattended hours based on certain months and operation code that user input into the form. I have two queries: one to calculate...
2
by: Sirrev | last post by:
MS Access 97 WinXP I've created a report bar graph and each bar represents the data from a different BU(Business Unit). The report bar graph works as it should except for the following :...
0
by: Just_a_fan | last post by:
Some folks have searched, from time to time, for a dual axis MSChart with different scales on the two Y axes. The sample, extracted from running code I wrote, produces a graph with MSChart (VB9)...
0
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); //...
2
by: thanawala27 | last post by:
Hello Friends, I'm new to VB.net, but have been programming from a long time in other languages. I wanted to plot a graph for one of my application in VB.net. I want a Time (X-axis) Vs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.