Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Khurram Khan Khan
  Where is Khurram Khan Khan?
 Khurram Khan Khan
 To: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Boudewijn Lutgerink
Subject: RE: Printing in Graph in Report (Boudewijn Help)
Thread ID: 27235 Message ID: 57751 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Reports and Printers
Date: Monday, December 13, 2004 7:43:43 AM         

> > Dear All,
> > I wanted to print a graph in my report from a table.The structure of table is Company Id c(2),Month n(2),Amount n(10,3). Amount should come in y axis, Company Id and month should in X axis. Does anyone know how can I make this graph at run time. Please help
> >
> > Thanks in advance
> >
> >
> > Jijo David
> Jeez, This is about to become my standard answer, use WORD.
> The file I refer to can be found here.
> I think you want some graph like this:
> It is EXTREMELY easy to integrate something like this in a word document and only a slightly more code to update it for every report you want.
> As you see the individual columns are bound to the results of a company (see legenda) and represent an amount.
> I added a bookmark to the graph in the document like "graph1" (Nifty hey!)
> Now, if you open the word document and rightclick on the graph object you get a contextmenu, select Graphobject->Open.
> What happens is that you get the graph object and the datasheet that's behind it.
> You can alter the data in the datasheet and the graph will adjust according to the data.
> In code it works like this:
> local loword as "word.application", loSheet as Object
> loword = createobject(""word.application")
> * assumed the doc is in the current directory and is named MyGraph.doc
> loword.documents.open( fullpath( curdir())+"MyGraph")
> loword.activedocument.bookmarks("graph1").select
> * activate the graph object is the same as opening it in word. Now we can access the datasheet
> *
> loWord.SELECTION.InlineShapes(1).ACTIVATE
> * make a reference to the sheet first
> *
> loSheet = loword.SELECTION.InlineShapes(1).OLEFormat.OBJECT.APPLICATION.DataSheet
> * assumed is that the name of the table is grfdata
> select grfdata
> 	FOR lnField = 1 TO FCOUNT("grfdata")
> 		IF LEN( FIELD(lnField))>0
> 			loSheet.Cells( <row>, <column> ).VALUE = EVALUATE( FIELD(lnVeld))
> * in the above for... endfor loop the <row> and <column> values are not filled in, you have to determine that for yourself.
> * now update the datasheet and the graph, THIS IS A MUST-DO!!
> loWord.SELECTION.InlineShapes(1).OLEFormat.OBJECT.APPLICATION.Update
> * print the document
> loword.activedocument.PrintOut()
> loword.activedocument.saveas( fullpath( curdir() )+"SomeNewName")
> loword.activedocument.close
> loword.quit
> release loword

> This is just a conceptual piece of code, you have to adjust it accordingly!
> Boudewijn LutgeĀ®ink
> Boudewijn.Lutgerink@foxite.com
> Reading is knowledge. Knowledge is power. Power corrupts. Corruption is a crime. Crime doesn't pay.
> Therefore, if you keep reading you'll go broke.


I have visual foxpro 6.0 it helpfull for me ..



Printing in Graph in Report Posted by jijo david @ 8/10/2003 7:37:48 AM
RE: Printing in Graph in Report Posted by Boudewijn Lutgerink @ 8/11/2003 7:49:48 AM
RE: Printing in Graph in Report Posted by jijo david @ 8/11/2003 1:05:26 PM
RE: Printing in Graph in Report Posted by Boudewijn Lutgerink @ 8/11/2003 2:25:24 PM
RE: Printing in Graph in Report (Boudewijn Help) Posted by Khurram Khan Khan @ 12/13/2004 7:43:43 AM