Export to Excel without flash and server-side

Export to Excel without flash and server-side

MisiuMisiu Posts: 68Questions: 4Answers: 2

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

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    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):

    1. The Sheet JS file (minified) is 404KB! That's just for the Excel part, more for all the shims etc.
    2. There is still no way of doing copy to clipboard on click without Flash
    3. I want to support IE8+ by default.

    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

  • MisiuMisiu Posts: 68Questions: 4Answers: 2

    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)

  • mmalmeidammalmeida Posts: 15Questions: 2Answers: 0

    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!

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Its coming! Approximately two weeks from now. it is already code complete and just needing the documentation :-)

    Allan

  • mmalmeidammalmeida Posts: 15Questions: 2Answers: 0

    Excellent news allan! Keep up the good work and keep us posted!

  • MisiuMisiu Posts: 68Questions: 4Answers: 2

    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!

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    :-)

  • mmalmeidammalmeida Posts: 15Questions: 2Answers: 0

    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

  • SeannSeann Posts: 6Questions: 0Answers: 0

    Really looking forward to this new version Allan, great to hear its coming. Is there any Alpha or Beta to test drive ?

    Thanks.

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    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

  • jlilesjliles Posts: 1Questions: 0Answers: 0

    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!

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Keep an eye on the blog for the announcement next week then :-)

    Allan

  • delfuegodelfuego Posts: 2Questions: 0Answers: 0

    Can't wait for this... I too would love to eliminate the Flash dependency!

  • nachoddnachodd Posts: 1Questions: 0Answers: 0

    Are you planning to integrate some new plugin, @allan?
    Do you have some news?
    Can't wait!!

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    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

  • delfuegodelfuego Posts: 2Questions: 0Answers: 0

    This all sounds awesome, Allan.

  • MisiuMisiu Posts: 68Questions: 4Answers: 2

    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!

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Yup - it will be shortly. I'll also be publishing the documentation for Buttons shortly - at the moment it is just tagged.

    Allan

This discussion has been closed.