473,657 Members | 2,505 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 5348
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_chartexpor t'
In the form properties of 'frm_chartexpor t' 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
1814
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 soultion. To change the text in a PivotChart LEGEND, switch from PivotChart View to PivotTable View. Then click once to highlight the field name that reads "Sum of...", then go to properties, when the properties dialog box displays select the...
0
1133
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
1771
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 filter the pivotchart. I tried me.CHILD.form.filter = ...
0
1525
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 to add some additional field not availible in data source ! :( I can't update field list of PivotTable to new data source without blanking all object and I have to do stiupid job again (selecting fileds,captions, colors, fonts, order of fieds...
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 around this? TIA
0
1213
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 (Scatter), i am able to select only one field for the y-axis. i am using access 2003 project with sql server.
0
1868
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 too many numbers after the decimal place for each figure. I went into the properties and changed the number format to "fixed" but it doesn't give me the option to change the number of decimal places that are used (it does every where else in MS...
1
1980
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 the 20 most recent values. The values have both a time and ID tag on them if that helps. For my second question: Is there a way to automatically update the pivot chart as the query is also updated? When I enter data into a form in one of my...
1
1450
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
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7324
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.