Datatables Table tools xls export issue in windows.
Datatables Table tools xls export issue in windows.
jyotijariwal
Posts: 27Questions: 2Answers: 0
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?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Where you say "import" do you actually mean "export"?
yes export my mistake. Do you have any solution?
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.
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.
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)
The replacement for TableTools, which should be out at the end of this week, all being well, will create XLSX files.
Allan
Thanks @allan a lot.
@allan You told me that Tabletools replacement will be launched? Is that launched now?
Not yet. Support took an unexpected amount of time last week, delaying the launch. it will be released tomorrow :-).
Allan
ok. Thanks. :)
@allan is that tabletools replacement launched?
Yes! Buttons.
HTML5 export demo.
Allan
@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?
Not without a test case showing the issue. Can you link to the page please?
Allan
@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.
Do you mean when you open the XLSX file? What are you using to open the files?
Allan
@allan I am using LibreOffice to open xlsx file.
@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?
That sounds like a bug - thanks for letting me know about that. I'll look at patching that.
Allan
@allan Do you know what is the issue of xlsx file not opening correctly in LINUX LibreOffice?
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
@allan thanks a lot. :)
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
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
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)?
@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
@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
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
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
Odd - it appears to work just fine for me with a Mac. What version of Excel are you using?
Allan