Datatables Table tools xls export issue in windows.

Datatables Table tools xls export issue in windows.

jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0
edited August 2015 in Free community support

I have implemented xls and csv import feature of table tools. In that we have
sExtends option. In that I have used "xls" for excel. But when I open that file in window Microsoft Office excel. It gives as invalid format. I am unable to understand this. Why this happens? On online demo of datatables we have excel option that also exports as csv. Can anyone help me out for this?

«1

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Where you say "import" do you actually mean "export"?

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    yes export my mistake. Do you have any solution?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    edited August 2015

    All I can say is that TableTools exports CSV format for its Excel option. To create the proprietary XLS format would be a nightmare!

    I suspect that you are changing your export file's file type from .csv to .xls, which would cause your problem. Excel would be happy with .csv but would be expecting .xls if you have changed the file type, which is wrong in this case.

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    ok So it is not possible with .xls. Why would then we require two buttons one of excel and other for csv. As both are making same file.

  • Heart1010Heart1010 Posts: 21Questions: 2Answers: 0
    edited August 2015

    xls variant stores that csv file in another "format" regarding BOM, csv delimiter, ... for example. Such "Microsoft Excel conform csv files" should open and be recognized with correct columns detection, correct umlauts (encoding) and so on...

    Background info about that:
    - On Windows, MS Excel, expects an UTF-8 encoded CSV with its corresponding BOM character (and semicolon delimiter).
    - On a MacOS system, MS Excel requires a CSV encoded in UTF-16 LE using the tab character as delimiter. (imho such csv files are generated with that xls option)

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    The replacement for TableTools, which should be out at the end of this week, all being well, will create XLSX files.

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    Thanks @allan a lot.

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan You told me that Tabletools replacement will be launched? Is that launched now?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Not yet. Support took an unexpected amount of time last week, delaying the launch. it will be released tomorrow :-).

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    ok. Thanks. :)

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan is that tabletools replacement launched?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    Yes! Buttons.

    HTML5 export demo.

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan thanks.

    I am now working on using buttons extension and change my code. I am working on intialzing it with new constructor.

    But it gives error -
    table.buttons is not a function.

    I am using it like -
    table.buttons().container().appendTo( $('.col-sm-6:eq(0)', table.table().container() ) );

    Can you tell me what I am doing wrong?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Not without a test case showing the issue. Can you link to the page please?

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan It was my fault that is resolved. I have successfully implemented that.

    Thanks for the buttons extension.

    Just one issue I am facing that xlsx file is showing empty records on LINUX system. In online demo also. But it works fine on windows.

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Do you mean when you open the XLSX file? What are you using to open the files?

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan I am using LibreOffice to open xlsx file.

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan I am facing one more issue of Colreorder not working properly with new colvis button which datatable provide in buttons extension.

    I have hidden three columns and when I reorder the columns through colreorder then colvis doesnot show columns.

    Do you know what is the issue?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    That sounds like a bug - thanks for letting me know about that. I'll look at patching that.

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan Do you know what is the issue of xlsx file not opening correctly in LINUX LibreOffice?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    Yes, I've just heard about that from someone else. I will look into it later this week. Hoping to do a new release of Buttons at the end of the week that will address all known issues (assuming they aren't too difficult to fix!).

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan thanks a lot. :)

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    I've just tried LibreOffice 4.4 and 5.0 on MacOS and it doesn't appear to have any problem reading the XLSX files. I'll need to download a Linux live CD and try that tomorrow in VirtualBox :-).

    Regarding the ColReorder / column visibility Buttons, I've committed a fix for that.

    Thanks,
    Allan

  • k4rl85k4rl85 Posts: 6Questions: 1Answers: 0
    edited August 2015

    Hi @allan i have the opposite problem.

    When i try to open the examples with a linux machine i can download and open xlsx files with Firefox 40 and Chrome 44 with both html5 and flash versions but there is a minor bug with firefox +html5 version where the file is read as a folder instead as a file but the file is OK.

    Instead when i try it in a windows 7 machine with internet explorer 11 or Chrome 44 both the version (html5 and flash) create empty file.

    Any suggestion to fix it in windows?

    Thanks a lot for your great work!

    Carlo

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Carlo - can you link to the page with the issue so I can try to debug it please. Or does this also occur on the examples on this site (if so, I haven't been able to reproduce it)?

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    @jyotijariwal - I've just tried LibreOffice 4.4.2.2 on Ubuntu and it appears to work okay with the created file. There is an issue with & characters, but I'd need a link to your page to be able to see what is going wrong.

    Allan

  • jyotijariwaljyotijariwal Posts: 27Questions: 2Answers: 0

    @allan Thanks for the checking. I am using Opensuse LibreOffice. Can you check on that? The xlsx button saves the file but opens it as empty. No text is therr

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Can you link to the page, as I asked please. I don't see why a different Linux distro would make any difference and I don't have enough time available at the moment to install another one.

    Allan

  • k4rl85k4rl85 Posts: 6Questions: 1Answers: 0
    edited August 2015

    The test i have done on excel export are still not running on example pages
    https://datatables.net/extensions/buttons/examples/flash/simple.html
    https://datatables.net/extensions/buttons/examples/html5/simple.html

    The CSV version have no problem so i use that for now

    Note: i have tried on a friend mac machine and excel version does not run

    Thanks,
    Carlo

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Odd - it appears to work just fine for me with a Mac. What version of Excel are you using?

    Allan

This discussion has been closed.