Forums

[Plugin: WP-Table Reloaded] Exporting tables to csv and/or excell for users usage (8 posts)

  1. Kidon
    Member
    Posted 2 years ago #

    Hi,
    I need a simple future to add an export to csv file button under the tables. Not for me (there is an option in admin panel), but for anonymous users. Is it possible?
    You know that - just like the Eurostat tables.
    10x,
    Best wishes,
    Jordan

    http://wordpress.org/extend/plugins/wp-table-reloaded/

  2. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    thanks for the feature request.

    I'll think about it for one the next versions. (There's also a ticket for this request in the Issue Tracker at http://code.google.com/p/wp-table-reloaded/issues/detail?id=34 already.)
    This might take some time though, as I'm currently busy with other things.

    Until then you'll have to manually export the file (from the admin panel) and upload it to your server and create the download link manually.

    Regards,
    Tobias

  3. Kidon
    Member
    Posted 2 years ago #

    Hi Tobias,
    Thank you for the reply.
    Your plugin is very good and I think that I will translate it to Bulgarian language. So - i will send .po and .mo files to you soon.
    10x again,
    All best,
    Jordan

  4. nycvelo
    Member
    Posted 2 years ago #

    Greetings. I'm glad that WTR now has an export-to-CSV function. However, I am having some trouble exporting this table.

    The problem is that Excel imports fields containing a comma as a new column, even when I use a semicolon or pipe or other non-comma character as the delimiter.

    Other save-to-CSV software I've used will escape fields with commas by putting quotes around the field. For example:

    Field1,Field2,"this field, as an example, contains commas"

    When editing large tables it's often useful to do so outside WordPress, thus escaping of fields-with-commas would also be useful. Can I request this as an addition to a future version of WTR?

    Thanks!

  5. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    thanks for posting this!

    Actually this is not a feature request, but a bug report. So, thanks very much! I don't know why, but actually using a comma should work as a separator. I'll have to check on why the cells are not escaped with quotes. I thought they were :-)

    As a work-aroung: Why don't you use the semicolon as a delimiter for now? There should not be any problems with that, those get escaped properly. And my Excel didn't have any problems opening the exported file when using a semicolon as the delimiter. Are you sure this is not working for you? (I actually tried with your table.)

    Thanks!
    Tobias

  6. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    I just checked, and there really was a small bug. The parseCSV class is missing a small line that actually sets the delimiter for the escape function.

    As it is only one line and nobody has noticed this bug before, I'm not going to release a new version just because of this, but instead wait for a few more changes.

    If needed, I suggest that you manually fix the bug: Just add the line
    $this->delimiter = $delimiter;
    right after
    if ( $delimiter === null ) $delimiter = $this->output_delimiter;
    in line 227 of the file parsecsv.class.php in the "php" subfolder.

    Hope this helps!
    Thanks for reporting that bug!

    Tobias

  7. nycvelo
    Member
    Posted 2 years ago #

    Thanks, Tobias! That workaround helps.

    Curiously, this addition correctly escapes fields containing commas when using a comma as the field delimiter, but does not work when other characters (such as the semicolon or pipe symbol) are used as delimiters. I am fine using commas, though.

    Thanks again!

  8. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    are you really sure about this? I just tried it again and with the fix from above all delimiters work and are escaped correctly.

    Have you inserted that line really in the correct place? If yes, it would be great if you could provide an example which is not working correctly (cell content you enter, export output the plugin generates, and export content you expected).

    Thanks a lot!
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Topic