tags:

views:

34

answers:

2

Hello I need to generate a report which would include both data and a graph image which is a pictorial representation of the data printed. Now the problem is, the function "stroke" in jpgraph generates the graph, so I get an error if I try to echo any information before the stroke function, and nothing prints onto the browser after the stroke function is executed. Do anybody know a way around for this problem??

Is there any other method to generate a report which has both the graph and tabular data.

A: 

JPGraph's Stroke() function will create the graph for you, but you can also pass a filename into the function. This will save the graph as an image which you can then load onto your report, and also output other data around it. For example:

// build graph code....
$graph->Stroke('mygraph.png');

echo "<img src='mygraph.png' alt='my graph' />";
echo "Anything I want to go with the graph";
gabe3886
Thanks a lot gabe!! hey is there anyway to add these images into an excel sheet??
sai
A: 

If you are using phpExcel, you can import image into excel easy. Like this: http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=28138

chuotlac