Easiest Way to Export a Google Visualization DataTable to CSV, XLS?

6,525 views
Skip to first unread message

Mark in A2

unread,
Dec 19, 2009, 3:02:02 PM12/19/09
to Google Visualization API
Relatively inexperienced, but finished my first real web-app that is a
dashboard utilizing Google visualizations. I have six datatables used
to support the visualizations. I would like to provide the option to
the user to export the datatables to text or xls. I'm looking for the
most straightforward way to do this. I've read through all of the
relevant material I can find on the topic, but cannot find anything
that appears to do the job (either that, or I just don't get it.)

Any help is greatly appreciated. The visualizations have been great
to work with (and learn some basic Javascript) and just need this
final piece!

Thanks,

Mark in Ann Arbor

chrissky

unread,
Dec 19, 2009, 10:32:45 PM12/19/09
to Google Visualization API
I think you will have to export JSON, and send that to the server to
be converted to XLS, then send it back to the client with the
appropriate MIME type.

Daniele

unread,
Dec 20, 2009, 4:20:05 AM12/20/09
to Google Visualization API

Mark in A2

unread,
Dec 22, 2009, 3:10:39 PM12/22/09
to Google Visualization API
Thanks for the suggestion. I may need take this kind of approach, but
not exactly clear on how to do. I will check it out.

Mark in A2

unread,
Dec 22, 2009, 3:13:47 PM12/22/09
to Google Visualization API
Thanks. Yes, I looked at this. It seems to require that the source
data is provided in the form of a URL (or at least those are all of
the examples it shows.) Could be my inexperience, but I don't get
it. I have the data in rows and columns within a datatable within the
dashboard page where the javascript is running. Why should I need to
(or how would I) supply a URL that the toolbar can use to export the
data? I'll take another look at it to see if I can figure out how to
use. If you have any tips on my question, they would be greatly
appreciated. Thanks again.

On Dec 20, 4:20 am, Daniele <der...@gmail.com> wrote:
> You can use the tool bar:http://code.google.com/apis/visualization/documentation/gallery/toolb...

Daniele

unread,
Dec 22, 2009, 4:35:36 PM12/22/09
to Google Visualization API
Unfortunately in the documentation I found this:

To use a toolbar, your visualization must get its data from a URL; you
cannot pass in hand-populated DataTable or DataView objects. You will
pass the URL of the data used to populate your visualization into the
drawToolbar() method.

So i think you should change approach.
Good luck :)

ChartMan

unread,
Dec 23, 2009, 3:59:42 AM12/23/09
to google-visua...@googlegroups.com
Using the Toolbar requires your data being served from a server.

--

You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



Reply all
Reply to author
Forward
0 new messages