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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print chart

Status
Not open for further replies.

Generalsndy

IS-IT--Management
Jan 22, 2016
7
PH
i use the chart wizard in vfp 9 to generate graph.
how to print or save it as image?
 
I don't know a VFP chart wizard, could you be more specific and perhaps give a short sample. Are you perhaps using the Graph Wizard? It makes use of the MS Graph OLE control. It's a data driven diagram and not a BMP or other pixel image type, so to reproduce the graph you rather store the data and query to reproduce it, than an image.

You better take a look at FoxCharts to produce better charts than via this outdated OLE control:

Bye, Olaf.
 
i have this form and it contains an ole class MSchart20lib.MSChart.2 to display the graph from the data on my table.
and now what i want is the generated graph is to be available for printing..kind of new in vfp,
by the way thanks for the suggestion but i really need to know this before going to foxcharts..
 
Although MS Chart is no longer supported by Microsoft, it does still work - although I agree with the Tore who said it is a pain to use. But if you must use it ....

MS Chart doesn't directly support printing. The best workaround I know is to call its EditCopy method, which puts a copy of the chart in the Clipboard. You can then paste it into a Word or Excel document - but use Paste Special / Picture rather than a straight paste - and print it from there.

You can also do the pasting and printing programmatically, via Automation. For more info and some sample code, see here, and scroll down to "How can I print my chart?".

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
yeah..tnx for the help sir mike..
can i just open the document instead of printing it directly?
 
Yes. In fact, the document is already open (I assume you mean the Word document), but it is initially invisible. You just need to add [tt]THISFORM.oWord.Visible = .T.[/tt] to the code to make it appear. And you can remove [tt]oDoc.PrintOut[/tt] if you don't want to print.

By the way, the article I linked to is based on my SimpleChart control, which is essentially a wrapper for MS Chart. It doesn't add any features to MS Chart, but it does make it easier to generate charts from a VFP cursor or table. You're welcome to use it, but note that it is about 15 years old, and I can no longer support it. If you're finding MS Chart difficult to use, you might prefer to go to FoxCharts instead, as suggested by the other.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top