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

How to Save Excel Chart to VFP General Field for printing

Status
Not open for further replies.

WIREMESH

Programmer
Joined
Mar 15, 2004
Messages
109
Location
US
I have data in a vfp table that I want to graph in EXCEL. From the examples listed on this site I can piece this together. However, I know want to save the graphic created in EXCEL back to VFP in a general field so I can run my VFP report. How can I save the chart to VFP General field?
 
Assuming that you have the chart sitting in an Excel spreadsheet, yuou save it like so:

Code:
*** Save to a temporary file
lcFileName = SYS( 2015 ) + '.xls'
loChart.SaveAs( FULLPATH( CURDIR() ) + lcFileName )

*** insert the graph into the general field in the cursor
SELECT csrGraph
APPEND GENERAL oleGraph FROM ( lcFileName ) CLASS "Excel.Chart" 

*** and clean up
ERASE ( lcFileName )


Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top