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

Use of General Field

Status
Not open for further replies.

prustie

Programmer
Aug 6, 2001
34
GB
Hi

I am using MSCHART to produce graphs in an application developed in VFP 6.0.

However I need to be able to print these graphs and the only way seems to be by holding the graph in a General Field in a temporary file and placing an OLEBOUNDcontrol into the report.

I cannot work out how to get MSCHART into the General Field can anyone help?

Regards

Malcolm.
 
Below is a sample. It was written long long time ago. I hope you could get the point.

SELECT SalesCode, SalesName, SalesFig ;
FROM SalesFile ;
INTO ARRAY aTmpArrary ;
ORDER BY 3 DESC, 2

pnArrayLength = ALEN(aTmpArrary) / 3
*Put sales names
pcGraph = CHR(9) + aTmpArrary(1,2)
FOR pnLoop = 2 to pnArrayLength
pcGraph = pcGraph + CHR(9) + aTmpArrary(pnLoop,2)
ENDFOR
*Put sales figures
pcGraph = pcGraph + CHR(13) + CHR(10) + "0" + CHR(9) + STR(aTmpArrary(1,3)) + CHR(9)
FOR pnLoop = 2 to pnArrayLength
pcGraph = pcGraph + STR(aTmpArrary(pnLoop,3)) + CHR(9)
ENDFOR
pcGraph = pcGraph + CHR(13) + CHR(10)

SELECT CsrTmp && Temporary File with General Field gABC
APPEND GENERAL gABC DATA pcGraph CLASS "MSgraph.Chart.8"


I hope it works. In addition, more controls could be added such as title, legend or etc.
 
Thanks

I have got MSGraph working although I am struggling with some of the properties.

However I was trying to make use of MSCHRT20.OCX which I can put in an OLECONTROL but not seemingly in a General Field connected to an OLEBOUNDCONTROL which is what I need in order to put it in a report.

Malcolm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top