FoxProFoxPro Developer's Conference '94 |
Session 125
All You Want To Know About FoxPro
and MSGraph*
Ted Roche
Computer Resource
Overview
FoxPro for Windows has built-in OLE capabilities, which can add entirely new features to your applications with minimal effort. The combination of MSGraph, GENGRAPH.APP and FoxPro for Windows lets you deliver powerful graph-enabled applications to your clients. During this session, Ted will review the capabilities of FoxPro, OLE and MSGraph. He will explain the interface between MSGraph and FoxPro, using the GENGRAPH.APP program, and demonstrate the output capabilities (in reports, labels and explicit @...SAYs) of OLE general fields
* but Microsoft forgot to tell you
All You
Want to Know About FoxProTM + MS GraphTM
Who is this guy?
Outline
Using the Graph Wizard
SHOWGRPH function
Syntax:
DO SHOWGRPH IN (_GENGRAPH) ;
WITH <expC1>, <expN1>[, <expC2>]
where:
<expC1> is the name of the graph database
<expN1> is the record number to refresh
<expC2> is an optional window title
@ ... SAY object command
Syntax:
@ <row, column> SAY <file> BITMAP | <general
field>
[STYLE <expC1>]
[CENTER]
[ISOMETRIC | STRETCH]
[SIZE <expN1>, <expN2>]
[NOWAIT]
MODIFY
GENERAL
Command
Syntax:
MODIFY GENERAL <general field1>[, <general field2>
...]
[NOMODIFY] | [NOEDIT]
[NOWAIT]
[[WINDOW <window name1>]
[IN [WINDOW] <window name2> | IN SCREEN]]
Use the Report / Label Picture Tool
SET DEVICE TO PRINT
@ 0,0 SAY olegraph SIZE 10000,10000 ISOMETRIC
Graphs in reports or labels
Updating graphs on the fly
reads data from current work area, recalculates
and redisplays graph
UPDATEGRPH function
Mode 0: same as REFRESHGRPH
Mode 1: better control, more work
Mode 2: the most work, the best control
mode 2 works in version 2.5a only!
REFRESHGRPH
Syntax:
DO REFRESHGRPH IN (_GENGRAPH) ;
WITH <expC>, <expN>
where:
<expC> is the name of the graph database
<expN> is the record number to refresh
Example:
DO REFRESHGRPH IN (_GENGRAPH) ;
WITH "QRYGRAPH.DBF", 2
UPDATEGRPH
Syntax:
DO UPDATEGRPH IN (_GENGRAPH) ;
WITH <expC1>, <expN1> ;
[, <expN2> [, <expC2> ;
[, <array>, <expC3>]]]
where :
<expn2> is the mode: 0, 1 or 2
<expC2> is a new graph title
<array> is a array listing the fields to graph
<expC3> is the X-axis field name
Store a database of template graphs
Recall a template and populate with new data
Distributing your application
Distribution Kit comes with Runtime GRAPH.EXE
Setup Wizard asks you to include the runtime GRAPH.EXE in your
distribution disks
Setup will not overwrite existing full-featured GRAPH.EXE
With Runtime GRAPH.EXE, you still can:
Use the Graph Wizard
Modify the data in the graph and recalculate it
Display and print the graph using methods above
Distributing your application
Limitations of Runtime GRAPH.EXE:
Cannot change graph type
Cannot modify fonts, colors or styles
Access to MSGraph menu interface denied:
Bibliography
For more information on MSGraph, OLE and graphic design issues, check out these resources:
The Design of Everyday Things, Donald A. Norman, 1988, Basic Books
The Visual Display of Quantitative Information, Edward R. Tufte, Graphics Press
Envisioning Information, Edward R. Tufte, Graphics Press
OLE Programmers Reference, 2 volumes, Microsoft Press, 1994
Inside OLE 2, Kraig Brockschmidt, Microsoft Press, 1994
Microsoft KnowledgeBase (GO MDKB or MSKB on CompuServe, or TechNet CD-ROMs) articles:
Q98770: Using REFRESHGRPH in GENGRAPH.APP
Q98771: Using GENGRAPH.APP to Update and Display Graphs
Q98772: Using SHOWGRPH in GENGRAPH.APP
Q100445: Character Field Appears as Date in Microsoft Graph
Q104052: FoxPro Sends Only Two Decimals to MS Graph
Q101597: Using UPDATEGRPH in GENGRAPH.APP
Using Microsoft Graph with FoxPro for Windows, Ted Roche, FoxPro Advisor, February 1994
Microsoft, FoxPro, MSGraph and other product and company names are trademarks or registered trademarks of their respective companies. Use of the code included herein is completely at your own risk; no liability is assumed by either DFPUG, Computer Resource, nor Microsoft for any damages incurred
All You Wanted to Know about FoxPro &
MSGraph
(c)1994 Ted Roche