• Resolved llorchdlp

    (@llorchdlp)


    Hello, first of all thanks for this great Plugin I’ve been using it a lot.

    My question is because I need to export one of my tables in CSV format but not from the admin page but from the front end page so the users can download the table in cvs format. Is that possible to do?

    Thanks in advance.

    https://wordpress.org/plugins/tablepress/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you could take a look at the TablePress DataTables TableTools Extension from https://tablepress.org/extensions/datatables-tabletools/

    Regards,
    Tobias

    It is greatly convenient for us to export table data when we combine use tablepress and dataTables Buttons plugins.

    Now, I have a small question. These two plugins use the data stored in Tablepress tables. If I have some data not created in tablepress tables, for example in form fields or table on front end page, and I want to save/export these data in csv/excel file, are there any ways to using dataTables buttons plugins? I found dataTables Buttons plugin uses javascript to export data. Is there any possible that I copy some functions to my site file to realize export data to csv or excel file.

    Which is the best method to export data to csv/excel file from front end page?

    Thank you, TobiasBg.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The CSV/Excel export via the Extension in the frontend is based on the JavaScript library from https://www.datatables.net/extensions/buttons/
    That however only works with HTML tables. So, if you can present your data in that form, you could use the library to offer a CSV/Excel export, even without TablePress.

    Regards,
    Tobias

    Thanks, Tobias.

    You mean if I create a table with html in a page and display data in that table, the buttons JavaScript library can offer CSV/Excel export?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, if you create an HTML table, you should be able to use that JavaScript library to offer CSV/Excel export. You will need some custom code to load and integrate it though, for which I can only refer to the DataTables documentation in that link that I posted above.

    Regards,
    Tobias

    Thank you for your explanation, TobiasBg.

    I can export table data as CSV/Excel file by integrating some codes in my child theme when data are loaded when webpage is opened.

    Now I meet another question. I create a table which is empty at first and table displays “No data available in table”. After user clicks the “Calculation” button, the new data are added into this table row by row. I find clicking CSV/Excel button cannot export data in the table, but only the table title. In addition, “No data available in table” still locates on the table even new data have been added.

    For this circumstance, how can I export these new added data by CSV/Excel button, which means how to dynamically bind CSV/Excel button to new added data. And how can I erase “No data available in table”.

    Thank you very much.

    I found the answer: Using DataTables API can resolve problems.

    DataTable API and extension offer a lot of function which can meet our needs.

    Thank you, DataTable developers!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.
    Also, sorry for the long wait for a reply. As a I was on a long vacation without internet access the last couple weeks, I could not reply earlier.

    Yes, when adding custom data dynamically, you will have to adjust the JS here. TablePress can not directly help with this, you will need custom code with the DataTables API.

    Regards,
    Tobias

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Front End CSV Export’ is closed to new replies.