Possibly a bug and some suggestions

Possibly a bug and some suggestions

MathObsessedMathObsessed Posts: 7Questions: 0Answers: 0
edited June 2012 in TableTools
Hi, Allan!

First of all, let me say HUGE THANKS for your fantastic work with dataTables plugin! It is really really awesome!
Now to my message:

1) Possibly a bug with tableTools 2.1.2.dev version:
It seems that when you export table to CSV and in some cell there is a data like "Innovation Center (aka "IC")" (with no outer quotes of course) in result.csv file we have a value "Innovation Center (aka "IC" (no outer quotes either) so the last quote entity and a bracket is gone for some misterious reason...

2) Suggestion 1:
I live in Russia and we here have this ugly "cp1251" encoding. Also every time I create a file in Windows XP it contains ANSI encoded data (instead of UTF8 as it's SUPPOSE to be) so when I export table into PDF or CSV I got ugly "??????" signs instead of words as a result. You can handle this if you open csv-file with OpenOffice (it allowes you to change encoding) but this doesn't work for pdf-files unfortunately... What do you think about adding "resultFileEncoding" property to solve this? Or maybe it is some workaround for this?

3) Suggestion 2:
There are many cases when we have a large table but we need to export only a PART of it. We cannot manage this directly with tableTools for now. I used to use colVis for this reason to hide unwelcomed columns before export. But that doesnt seems to be a solid way to do this.

4) Suggestion 3:
A have large complicated tables as I mentioned before and I also have additional information in TH tags like "ColumnName BRtag columnDescription" which ALSO going right into my csv-files... As all HTML tags removed from result files I have some unreadable headers...

That seems to be it. I think that's not only my personal problems but kinda plugin "convinience" problems here. If I could help you with coding or any other way - just let me know, I'll gladly do my best for you.

Cheers! Keep up the good work, man!

~Ernest Lebedev

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Ernest,

    Thanks for your comments and feedback!

    1. I've just created this example, and it appears to be working as I would expect with your string: http://live.datatables.net/uratux/edit#javascript,html . Perhaps you can link me to a test case that doesn't work?

    2. PDF won't work with UTF-8 or not ASCII characters due to a limitation with the PDF library (its on the to-do list to look into that). With CSV files, TableTools only really has the capability of outputting UTF-8 or UTF-16LE files - I've not attempted to support other character encodings as I'm sure that would turn into a huge can of worms!

    What is the "resultFileEncoding" property you mention?

    3. You can use mColumns ( http://datatables.net/extras/tabletools/button_options#mColumns ) to tell TableTools what columns to export :-).

    4. Good point. TableTools has fnCellRender for rendering the text in cells, but it doesn't have something similar for header elements. I've added an issue for this option: https://github.com/DataTables/TableTools/issues/13 - although it probably won't be until after 2.1.2 for that (I want 2.1.2 to be for satiability with the button issues in 2.1.1 only!).

    Allan
  • MathObsessedMathObsessed Posts: 7Questions: 0Answers: 0
    Thanks for a quick response, dude!

    1) It's really strange but i can't figure out how to show you this bug (if it is a bug of your plugin not my mistake somewhere else in the code, but the HTML code in my application seems to be absolutely similar!). I inserted my THEAD and TBODY data into your test case and it works fine indeed... I'm a bit confused, but will try to solve this later myself so never mind =)

    2) PDF seems not to be working in my application for now so I'll just exclude this button =)
    The "resultFileEncoding" property is just my suggestion about the output file data encoding (now it is UTF8 for me which is totally fine). So never mind about that too =)

    3) Wow! Totally missed that... Thank you!

    4) I'll be waiting impatiently for this feature, thank you again!

    ~Ernest Lebedev
  • timtenntimtenn Posts: 1Questions: 0Answers: 0
    Is it possible to have the export to CSV file retain any HTML tags that are in the data? Right now, when I export data from my mysql database, it removes the html formatting characters like etc.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Yes - specify an fnCellRender function ( http://datatables.net/extras/tabletools/button_options#fnCellRender ) that doesn't strip the HTML from the output.

    Allan
This discussion has been closed.