473,503 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exporting pivotchart to graphic

58 New Member
Howdy all!
I need help exporting a pivotchart to a .png
I have a form 'frm_forquery' that allows a user to select a value called "TMC", this then runs a query and opens the pivotchart 'frm_selectTMC' based on that users selection.
I would like to export the chart to a jpg..
I added a command on 'frm_forquery' and have been working on this code, but i keep getting run-time error '2467' the expression you entered refers to a object that is closed or doesn't exist....
here is the command code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command13_Click()
  2. Dim outputDir As String
  3. Dim TMC As String
  4. Dim plot_model As String
  5. Dim form_name As String
  6. Dim graphForm As Form
  7.  
  8. TMC = "Select TMC Chart"
  9. outputDir = "C:\"
  10. form_name = "frmSelectTMC"
  11. plot_model = "frmSelectTMC_"
  12.  
  13.  
  14. Set graphForm = Forms(frmSelectTMC)
  15. graphForm.ChartSpace.ExportPicture outputDir & plot_model & TMC & ".jpg", "JPG", 1024, 800
  16.  
  17. End Sub
  18.  
any thoughts would be greatly appreciated
cheers,
Eric
Oct 16 '06 #1
1 5332
erbrose
58 New Member
Howdy all!
I need help exporting a pivotchart to a .png
I have a form 'frm_forquery' that allows a user to select a value called "TMC", this then runs a query and opens the pivotchart 'frm_selectTMC' based on that users selection.
I would like to export the chart to a jpg..
I added a command on 'frm_forquery' and have been working on this code, but i keep getting run-time error '2467' the expression you entered refers to a object that is closed or doesn't exist....
here is the command code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command13_Click()
  2. Dim outputDir As String
  3. Dim TMC As String
  4. Dim plot_model As String
  5. Dim form_name As String
  6. Dim graphForm As Form
  7.  
  8. TMC = "Select TMC Chart"
  9. outputDir = "C:\"
  10. form_name = "frmSelectTMC"
  11. plot_model = "frmSelectTMC_"
  12.  
  13.  
  14. Set graphForm = Forms(frmSelectTMC)
  15. graphForm.ChartSpace.ExportPicture outputDir & plot_model & TMC & ".jpg", "JPG", 1024, 800
  16.  
  17. End Sub
  18.  
any thoughts would be greatly appreciated
cheers,
Eric
Here is the work-around that I found for anyone who cares....
I copied/paste my pivotchart form 'frm_selectTMC' and called the copy 'frm_chartexport'
In the form properties of 'frm_chartexport' i built an event procedure for "on open" with the following code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form Open (Cancel as Integer)
  2. Me.ChartSpace.ExportPicture "c:\temp\test1.jpg", "JPG" , 1000, 1000
  3. End Sub
Now on the 'frm_forquery' I added a command button called "export"
with the following code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Export_Click()
  2. DoCmd.OpenForm "frm_chartexport", acFormPivotChart
  3. DoCmd.Close asForm, "frm_chartexport
  4. End Sub
its a bad work-around but it at least works, now for more bugs!
Cheers,
Eric
Oct 17 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1801
by: Tracy Griever via AccessMonster.com | last post by:
Simple way to change/remove the "Sum of..." text, or any text, in a PivotChart LEGEND. I searched other sites for many hours and could find no help on this subject...a co-worker stumbled upon the...
0
1119
by: Gargamil | last post by:
I've created a series of Pivotcharts in Access 2002. How do I export the chart to a GIF? I do it all the time with charts in forms and reports - can't get it happening in the Pivotchart g
1
1767
by: windandwaves | last post by:
Hi Folk I am trolling Google groups to find info, but so far unsuccessful. I have a form with in it a subform which is a pivotchart. From the main form, I have created a control that should...
0
1519
by: Filo | last post by:
Hello, Design nice PivotTable or PivotChart (selecting fileds,captions, colors, fonts, order of fieds etc.) sometimes takes more then 1 hour and I hate when after this my boss (or I self) ask me...
0
413
by: francophone77 | last post by:
I created a button to open a pivotchart, but each time I click the button, it comes up in form view and I have to switch the view to pivotchart view in order to see the chart. Is there anyway...
0
1202
by: guaj1818 | last post by:
was wondering how i can create a pivotchart with 2 or more fields on the y-axis with a value x axis, e.g. 20-200, interval: 40. i only get a category x axis when choosing a Line chart. with the XY...
0
1844
by: pomeroymiles | last post by:
I have a pivotchart which I cause to take a huge list of people's test percentiles and calculate the average for each year. I then display the average above each bar. The problem is that there are...
1
1975
by: grgimpy | last post by:
I have a pivotchart in a tab in my main form. First question: Is there a way to display only a certain number of the most recent records? For example, to limit the pivotchart to displaying only...
1
1444
by: sanniep | last post by:
Dear Expert, I would like to program a button to export an Access pivotchart to Excel. The predefined button works ok but I would like to automate it. Thanks, Sander
0
7074
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
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
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...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5572
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
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.