Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSGraph
Message
From
18/12/1998 11:30:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Miscellaneous
Thread ID:
00162413
Message ID:
00168890
Views:
27
>>>>>My coworker has a form with a graph from MSGraph on it. He has been unable to find a way to print the graph. Anyone know how?
>>>>>
>>>>>Thanks,
>>>>>
>>>>>-Michelle
>>>>
>>>>If you store graph in General field, then you add Picture/OLE Bound Control to Report form, bind it to this field and print.
>>>
>>>How do you store the graph in a general field? Right now, it's just a control on a form.
>>>
>>>Thanks,
>>>
>>>-Michelle
>>
>>You should get some values inside the control to show some graph, right?
>>
>>for nLoop=1 to alen(aValues,1)  && aValues contains needed values from table(s)
>> cLegends=cLegends+chr(9)+alltrim(aValues[nLoop,1])+ ;
>>  str(100*aValues[nLoop,2]/nCounthist,6,2)+"%"
>>  cValues=cValues+chr(9)+str(aValues[nLoop,2])
>>endfor
>>cGraphstring=cLegends+chr(13)+chr(10)+"Value"+cValues
>>wait window "Formatting Graph... Wait, Please!" nowait
>>if used("tmpStat3")
>> select tmpStat3
>> use
>>endif
>>create cursor tmpStat3 (genfield G)
>>append blank
>>append general genfield class "msgraph.chart" data cGraphstring
>>if type("this.oleGraph")<>"O"
>> this.addobject("oleGraph","Oleboundcontrol")
>>endif
>>with this.oleGraph
>> .left=this.shGraph.left+1
>> .width=this.shGraph.width-2
>> .top=this.shGraph.top+1
>> .height=this.shGraph.height-2
>> .autoactivate=0		&& no on-line setting
>> .controlsource="tmpStat3.genfield"
>> do case
>>  case nStyle=1	&& bar
>>   .haslegend=.f.
>>  case nStyle=2	&& pie
>>   .haslegend=.t.
>>   .autoformat(5,1)
>> endcase
>> .visible=.t.
>>endwith
>>
>
>
>He got it working with your code. Thanks!
>
>-Michelle
Michelle,
Little tip : Report form printing with MSGraph has problems if you change charttype on the fly. As a workaround :
1) Use preview and mimic one time mouse click on preview window (as if zoomed out).
2) Or..Copy graph datasheet to an excel object worksheet, create chart and printout.
3) Or...Directly use excel instead of MSGraph.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform