Export to Excel without flash and server-side
Export to Excel without flash and server-side
Some time ago I've tried to get rid of flash when exporting to excel, back then my only option was to use server-side script or use TableTools and export to csv.
I want to present proof of concept that allows to export table to Excel's XLSX 2007 format.
http://live.datatables.net/pudavuya/1
I'm using sheetjs (http://github.com/SheetJS/js-xlsx).
This is only basic example of what can be done. I'll try to add this to TableTools, but this can take time, because I'm still learning new API.
Same thing with PDF (http://github.com/MrRio/jsPDF)
Allan what do You think about this? Maybe this is future do TableTools?
Replies
Thanks for this. There are a couple of issues I have with integrating this directly into TableTools (or rather, the new Buttons extension I'm working on - TableTools will not see any new features added now):
My current plan for Buttons is to offer basically the same functionality as TableTools by default (Flash based copy, csv and pdf). Buttons will also be a lot more extensible and I'll be "advertising" the plug-in buttons a lot more, so things like jsPDF and SheetJS based buttons can be easily used by developers that are willing to accept their limitations / advantages (depending upon your point of view).
Indeed the Flash based buttons are going to be plug-in based themselves
and they might need to be optionally included.
Allan
Thanks for interest and for reply.
Size is an issue, but this depends on where You are planning to use this. For intranet applications it isn't such a problem.
I just checked my JSBin in Chrome and I see different size.
My example only uses xlsx.core.min.js and Chrome shows two sizes (119KB and 395KB, don't know what does mean, probably GZIP compression)
Other files are: Blob.js (2.2KB, 5.1KB) and FileSaver.js (3.4KB, 8.9KB)
On js-xlsx I can see it was tested in IE6+ (https://github.com/SheetJS/js-xlsx#tested-environments)
I'll wait for new extension and maybe I'll try to create extension for it.(can You reveal release date)
This is an excellent prospect. With the increasing security vulnerabilities Flash has, having an alternative that is Flash-free is crucial for the long-term healthiness of this feature!
Its coming! Approximately two weeks from now. it is already code complete and just needing the documentation :-)
Allan
Excellent news allan! Keep up the good work and keep us posted!
I've already seen code, can't wait for finale result.
DataTables is and awesome library and it keeps getting better and better.
Keep up the good work!
:-)
It seems this is a great time to be reviewing this!
Mozilla seems to have taken one more step to kill Flash:
http://www.computerworld.com/article/2947898/security/mozilla-blocks-all-flash-in-firefox-after-third-zero-day.html
Really looking forward to this new version Allan, great to hear its coming. Is there any Alpha or Beta to test drive ?
Thanks.
Not at this time - as I don't have enough time to support alpha / beta versions particularly as the documentation hasn't been fully written yet.
Allan
I'm waiting impatiently for this, I've got the Flash version running in our project, but I'd really like to eliminate the Flash requirement. Mark me as another interested party!
Keep an eye on the blog for the announcement next week then :-)
Allan
Can't wait for this... I too would love to eliminate the Flash dependency!
Are you planning to integrate some new plugin, @allan?
Do you have some news?
Can't wait!!
Unfortunately this is going to fall over into next week now - documentation is taking quite a bit longer than expected!
The new library (Buttons) will make use of modern DOM methods and also the PDFMake and JSZip libraries to create the required files. IE10+ or any of the evergreen browsers are required for this to work. Flash export buttons will also optionally be available for legacy browsers.
To my mind it (and all the other software coming next week) are a big step forward :-)
Allan
This all sounds awesome, Allan.
Hi Allan.
I just noticed that Buttons just hit 1.0.0 (awesome!) any chances that today DataTables 1.10.8 will be published to public (as finale version)?
Once again many many thanks for Your awesome work!
Yup - it will be shortly. I'll also be publishing the documentation for Buttons shortly - at the moment it is just tagged.
Allan