*** set the LOCALEID to English nlLocaleId=sys(3004) && Save local id =sys(3006,1033) && We will be sending instructions in English * Part of xlChartType constants #include xlconstants.h #Define TABULATE CHR(9) Wait window nowait "Filling cell values..." Select country,cnt(*) as 'Count' from customer group by country into cursor crsGraph lcTempFile = sys(2015)+'.tmp' Copy to (lcTempFile) type CSV MCGDATA = chrtran(FileToStr(lcTempFile),',',TABULATE) Erase (lcTempFile) Create cursor testgen (graphtest g) Append blank Wait window nowait "Plotting..." Append general graphtest class MSGraph.Chart data MCGDATA oForm = createobject("myForm") With oForm .show .addobject("myGraph","OleBoundControl") With .myGraph .height = oForm.height - 10 .width = oForm.width - 10 .left = 5 .top = 5 .ControlSource = "testgen.graphtest" .object.application.plotby = xlColumns .ChartGroups(1).Gapwidth = 300 Endwith .myGraph.visible=.T. Endwith Wait clear **** Set the LocaleId to the previous value =sys(3006,val(nlLocaleId)) Read events Define class myForm as Form Width=800 Height=600 Name='MyForm' BackColor = rgb(255,255,196) Procedure QueryUnload Clear events Endproc EnddefineCetin