Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting charts to jpeg/gif

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
Hi folks,

I have a chart on a form which I am exporting to jpeg with the following sub in a buttons on click event:

Private Sub jpeg1_Click()
On Error GoTo Err_jpeg1_Click

Me.Graph1.Export "c:\DATABASE GRAPHS\Throughput_Vs_Target.jpg", "JPEG"
Me.Graph1.Locked = False
Me.Graph1.Enabled = True
Me.Graph1.Action = acOLEClose
Exit_jpeg1_Click:
Exit Sub

Err_jpeg1_Click:
MsgBox Err.Description
Resume Exit_jpeg1_Click

End Sub

The problem is every time I export it cuts off a chunk of text from the end of my chart labels. Has anybody else seen this before and fixed it? I can't find any help online.

Also is there a way to export charts to jpg/gif from a report? I have tried putting the following in the detail sections on format event on my report:

Me.Graph1.Export "c:\DATABASE GRAPHS\Throughput_Vs_Target.jpg", "JPEG"

... but this keeps producing an OLE error and closes access.
 
Not sure if it'll help, but someone mentioned in the comments on this blog posting on same topic that png works better than jpg for things like this.


I may try to dig in a little further myself. I know it's something I've been curious about a couple of times, and maybe had someone ask me about it in the past... so at least interested. [wink]

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
That site has been blocked here by the IT folks.
 
Ah yes, I know the feeling - it's likely something to do with being a blog. Perhaps you can access it externally or else view a cached version of it?

You could try a Google search for:
cache:
That works on occasion, but not always.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top