report form testgraph preview nowait mouse click window ("Report Designer") report form testgraph to printer noconsole release window "Report Designer"I know it's not a good way but currently is the only way I know to accomodate charttype change on the fly w/o user intervention.
*** 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 #define xl3DArea -4098 #define xl3DColumn -4100 #define xl3DLine -4101 #define xl3DPie -4102 #define xlArea 1 #define xlBubble3DEffect 87 #define xlLine 4 #define xlPie 5 #define xlRadar -4151 #define xlSurface 83 #DEFINE TAB CHR(9) #DEFINE CRLF CHR(13)+CHR(10) create cursor test (degree i, sine n(8,4) NULL, cosine n(8,4)) for ix = 1 to 90 insert into test ; values ; (ix,cos(ix)*ix,sin(ix)*ix) endfor 45 scan next 30 && Nullify 30 degrees replace sine with .null. && Nullify some values to see effect endscan * Data prepare * wait window nowait "Pls wait. Generating report..." MCGDATA = "" nCols = fcount() for ix = 1 to nCols MCGDATA = MCGDATA + iif(empty(MCGDATA),"",TAB)+field(ix) endfor MCGDATA = MCGDATA + CRLF scan for ix = 1 to nCols MCGDATA = MCGDATA + iif(ix=1,"",TAB)+nvl(str(evaluate(field(ix))),"") endfor MCGDATA = MCGDATA + CRLF endscan * Data prepare * create cursor testgen (genfld1 g) append blank append general genfld1 class "msgraph" data MCGDATA *create report testgraph from testgen form * modi report testgraph * Report form is ready made *** oForm = createobject("Form") with oForm .height = 400 .width = 600 .addobject("myGraph","OleBoundControl") with .myGraph .height = oForm.height - 20 .width = oForm.width .left = 0 .top = 0 .ControlSource = "testgen.Genfld1" .hastitle = .t. .haslegend = .t. .ChartTitle.caption = "This is chart title" .visible=.T. .ChartType=xlBubble3DEffect .object.application.plotby = 2 .refresh endwith endwith **** Set the LocaleId to the previous value =sys(3006,val(nlLocaleId)) report form testgraph preview