Export Table to XLS and Open Without Save it

Export Table to XLS and Open Without Save it

Alex0520Alex0520 Posts: 3Questions: 0Answers: 0
edited September 2011 in General
Hello, I have a trouble, I'm using DataTable's plugin to export a table to Excel, but I need that the users can open the exported table without save it...

Someone Could help me??

Thanks

Replies

  • allanallan Posts: 61,654Questions: 1Answers: 10,094 Site admin
    So basically what you are looking for is for when the click occurs to save the file, rather than saving it, open it in Excel?

    This unfortunately isn't possible since the XLS export is dependant upon Flash, and currently (at least as far as I am aware) there is no option in Flash to open a native application.

    There are two options which might be possible, but each with drawbacks:

    1. Use a server-side process to create the XLS and download it on the button click - this would present the browser's Save / Open / Cancel dialogue box, giving the user the option.

    2. You could use the data:// pseudo protocol to create the same effect, entirely client side, but this won't work in older version of IE.

    Also with either option there would be a little bit of work involved.

    Sorry I don't have better news.

    Allan
  • Alex0520Alex0520 Posts: 3Questions: 0Answers: 0
    Hello Allan, thank's for yor help, could you give me an example from the two options?

    Thank's

    Alexander
  • allanallan Posts: 61,654Questions: 1Answers: 10,094 Site admin
    Hi Alexander,

    There is the download plug-in for TableTools which would help with option 1: http://datatables.net/extras/tabletools/plug-ins#download . If you'd like me to create a full working example for it, feel free to hit the "Support" link at the top of the page.

    Allan
  • Alex0520Alex0520 Posts: 3Questions: 0Answers: 0
    Hello Allan, I was seeing the link, but when i use the code, it throws an error that says:

    "this.s.dt.oApi._fnAjaxParameters is not a function"

    Could you help me?

    Thank's

    Alex
  • allanallan Posts: 61,654Questions: 1Answers: 10,094 Site admin
    You'll need to be using DataTables 1.8.2 or later as that's a new function. The plugin must have a requirement on the new version.

    Allan
This discussion has been closed.