KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataTable export to Excel #1329

Closed ankit raj opened this topic on on Mar 4, 2020 - 2 comments

ankit raj commented on Mar 4, 2020

Hello , I need to export a dataTable to excel with one button click like the original Datatables has. Is there a way to do it?

David Winterburn commented on Mar 5, 2020

Please go to this example to see which plugins you need:

https://datatables.net/extensions/buttons/examples/initialisation/export.html

Then go to this page to download DataTables.min.js with previous plugins:

https://datatables.net/download/

Finally replace the file datagrid/DataTables/datatables.min.js with your downloaded file and set up the widget like this:

DataTables::create(array(
    ...
    "options" => array(
        ...
        "dom" => 'Bfrtip',
        "buttons" => [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ],
    )
));

Please try this and let us know how it works for you. Thanks!

ankit raj commented on Mar 6, 2020

Thanks it worked like a charm.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

DataGrid