Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Statistics graphics in VFP 5.0
Message
De
02/08/1997 12:04:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/08/1997 21:59:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00042858
Message ID:
00042898
Vues:
57
>Hello.
>
>I want to show some statistics graphics reports based in the data in my aplication without user intervention.
>What is the way to do it directly?
>
>Thank You

Hi Victor,
Here is the init code of one of my forms that is used to display Graph reports w/o user intervention and wizard.

parameters graphType, graphSubType
****************
* GRAPHFORM.INIT
* GRAPHFORM has an oleboundcontrol and a button to close form
* GraphType
* 1 Area, 2 Bar, 3 Column, 4 Line, 5 Pie, 6 XY scatter, 7 Combination,
* 8 3-D Area, 9 3-D Bar, 10 3-D Column, 11 3-D Line, 12 3-D Pie
* graphSubType corresponds to subtypes that you see when you select a category from chart wizard
*
*************************************************************
*****************
* Here goes your SQL, view etc
*****************
select bolge, sum(kilo) as kilo ;
from bolge, (dbname) ;
where bolge.bolge_kodu = left(cari_no,4) ;
and Tarih between dStart and dEnd ;
group by 1 into cursor query
*************
* Convert data to a tab delimited file && Could be done by "copy to ... delimited with tab" but this works better
*************
********************
* This part is also in VFP examples - a little modified
********************
#define TAB chr(9)
#define crlf chr(13)+chr(10)

M.CGDATA = ""
scan
m.cgdata = m.cgdata+TAB+bolge
endscan
m.cgdata = m.cgdata +crlf+"Kilo"
go top
scan
m.cgdata = m.cgdata+TAB+str(kilo,7)
endscan
graphType = 5
graphsubType = 6

create cursor foo (gen1 g)
append blank
append general gen1 class "msgraph.chart" DATA M.CGData
THIS.LockScreen = .T.
THIS.OleBoundControl1.ControlSource = "Gen1"
THIS.OleBoundControl1.HasLegend = .t.
THIS.OleBoundControl1.autoformat(graphType, graphSubType)
THIS.LockScreen = .F.

Form contains only another button control with thisform.release in click control. (In fact I have a calling form to select data and graphtype,subtype).
I hope this helps.
PS:Detailed data about MSgraph5 could be found in \windows\msapps\graph5\vba-grp.hlp
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform