Link to home
Start Free TrialLog in
Avatar of Sevron
Sevron

asked on

Exporting Fusion Charts to PDF

Hi we have a reports area of our system which enables the user to view charts for different area and locations.

We now need to export all the charts which are currently being viewed to a PDF or as an image. We are using Fusion Charts, and using the javascript method with XML files to create the charts (so not the flash method to generate the charts). The attached image is an example of what our system looks like for the reports area.  

The user can search using the form at the top and then the reports are shown with the appropriate data for the chosen area at the bottom.

We have been looking at TCPDF but
Our-system.png
Avatar of BlueYonder
BlueYonder

Here is another option, http://blog.fusioncharts.com/2009/05/export-your-charts-as-images-or-pdfs/.  It does both image and pdf.
Avatar of Sevron

ASKER

Hi thanks for the reply, we looked at this but when you look at it in more depth it requires the server setting up with additional open source software, and other tweaks we would like to avoid that as the server currently hosts several of our products.
We have been looking at TCPDF but
But what?  In my experience the two "mainstream" PHP libraries are FPDF and TCPDF.  Have a look at the question over here for a couple of examples of the "hello world" exercises using these class libraries.

The largest challenge you may face arises from the way Fusion Charts uses the client-server model.  Your data is built on the server, then sent to the JavaScript client in XML format, where the chart rendering takes place under control of the web browser.  If you want to create a PDF, however, the entire process lives on the server.  What this means, in a nutshell, is that you lose the chart rendering of JavaScript and you're back to just having the XML document.  You can't export the charts to PDF; the data has already been exported before the chart is rendered, and you can't readily get it back from the browser.  There are some Windows-only capabilities in PHP that might be useful, but I've never heard a satisfactory success story.

I often see questions that go something like, "How can I convert my web page to PDF," and there really is not any good answer for a question like that.  These two things are "fish and fowl," both consumables but not at all alike.  A more successful path is usually found when the question is "How can I render the data that is currently shown on my web page, but on paper, in the form of a PDF?"  That leads you in the direction of the server-side technologies that can be made to work well.

You might consider JpGraph.  It can build the server-side image files you need.  You might also consider doing a bit of your own rendering using the PHP image manipulation functions.  It looks like it is unsupported, but FCImg might be useful.  I have never tried it, but it sounds promising.  It's a bit of a Rube Goldberg design with a lot of moving parts and it would probably be a release-maintenance headache, but it might be worth a test drive.
Avatar of Sevron

ASKER

""We have been looking at TCPDF but"
But what?"

But TCPDF cant gather the  Rendered Fusion Charts.
If you want the rendered Fusion Charts and you're not able to accept anything else, you're putting a big risk into the project.  I understand that may be necessary.  I would look at FCImg.  But I would also have the nagging doubt that it's kind like chemotherapy.  It might work, but only if accompanied by prayer and good luck.  And it might not.  

If this were my project, I would start by setting up a group of qualification tests that could show you, quickly, whether FCImg was a good solution.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points and thanks for using EE, ~Ray