Okay
  Public Ticket #2236203
Downloading full table
Closed

Comments

  • Ryan Vaughan started the conversation

    Hi Support, 

    We have a large database that ideally we do not want people to view all rows within the website. For reference have about 20k rows and growing with many columns.

    a) Can a user download the entire database to excel without viewing all the table data within the browser?

    b) Can we limit the rows viewed to say 500 instead of the option to view all? Are we able to edit those options? 

    Thank you

    Ryan

  •  2,572
    Aleksandar replied

    Hello Ryan.

    a. Unfortunately something like this is not possible with the built-in table tools. Nothing that's not visible on the page can be exported to any format, and with a table with 20k rows - it wouldn't be possible to display all entries. Or, even if it's possible, it would load very slowly. Maybe you would like to take a look at our paid add-on Report Builder. You can use that to create an Excel or a Word template, and to export the entire table as a report file.

    b. At the moment, you can display 100 rows in "Default rows per page" feature, located in the Display tab above the table:

    1887812261.png

    Adding another value is possible, although it'd require some code changing. If you're willing to do this, please let me know, and I'll send you the instructions how it can be done.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Ryan Vaughan replied

    Hi Aleksandar,

    Thank you for getting back to me. 

    Understood about the default table tools... I thought as much but if your Report Builder will do the trick then I'll purchase that and take a good look through. 

    Regarding the code changes, if you could send me the instructions, I will do what I can my end. 

    Thank you for your assistance. I am really happy about the report builder if it can do what I need it to.

    Ryan

  •  2,572
    Aleksandar replied

    Hi again Ryan.

    I'm glad to hear you'd like to try out the Report Builder. It's available on our sandbox site, but even if you purchase, and it doesn't do what you need it to do, you have 15 days to ask for a refund, and you will be reimbursed.

    As for adding more rows to the table:

    You need to add a line of code to ../wp-content/plugins/wpdatatables/templates/admin/table-settings/table_settings_block.inc.php and around line 331, like this:

    <select class="form-control selectpicker" id="wdt-rows-per-page">
       <option value="1">1</option>
       <option value="5">5</option>
       <option value="10">10</option>
       <option value="25">25</option>
       <option value="50">50</option>
       <option value="100">100</option>
       <option value="500">500</option>
       <option value="-1"><?php _e('All', 'wpdatatables'); ?></option>
    </select>
    

    This adds "500" in the Display tab above the table:

    3076079834.png

    Then, open ../wp-content/plugins/wpdatatables/source/class.wpdatatable.php and around line 3196, add "500", so it looks like this:

    $obj->dataTableParams->aLengthMenu = json_decode('[[1,5,10,25,50,100,500,-1],[1,5,10,25,50,100,500,"' . __('All', 'wpdatatables') . '"]]');
    

    And the last thing to do is to go to line 498 of the same file, and modify it so it looks like this:

    public function setDisplayLength($length) {
            if (!in_array($length, array(1, 5, 10, 20, 25, 30, 50, 100, 200, 500 -1))) {
                return false;
            }
    

    So, again, you only need to add "500".

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Ryan Vaughan replied

    Thank you again for your support and instructions. I will attempt to make the changes this evening and see how we get on. 

    I did purchase the reports plugin and set something up very quickly to test it out. Everything worked as you might expect although I found the report generation to download was very slow. It kept the formatting of the original spreadsheet which was fantastic, I am just a little worried about the speed, especially if the file has some 20k records. 

    We are going in the right direction and I love the plugins, makes me look good :D 

  •  2,572
    Aleksandar replied

    I'm glad to hear that, Ryan.

    The size of the table does affect the loading speed. That's something we cannot affect, and the only factors taken into account here are hosting plans and server performance.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables