How to use buttons like excel ,print on Multiple tables

How to use buttons like excel ,print on Multiple tables

sainixsainix Posts: 13Questions: 6Answers: 0

i m using two datatable on same page but buttons not work fine if we use two tables

$(document).ready(function () {

        var table = $('table.display').dataTable({

            "pageLength": 100,

            "bSort": false

        });

        var tableTools = new $.fn.dataTable.TableTools(table, {



            'aButtons': [

                {
                    'sExtends': 'print',
                    'bShowAll': true,
                },

                    {
                        'sExtends': 'xls',
                        'sButtonText': 'Save to Excel',
                        'sFileName': 'Report.xls'
                    },
                    {
                        'sExtends': 'pdf',
                        'bFooter': false
                    },

                ],
                'sSwfPath': '//cdn.datatables.net/tabletools/2.2.4/swf/copy_csv_xls_pdf.swf'

            });


        $(tableTools.fnContainer()).insertBefore('#table-demo_wrapper');

    });

Answers

  • allanallan Posts: 63,210Questions: 1Answers: 10,415 Site admin

    There is no option to have Buttons export data from two different tables in a single file I'm afraid. That is not a feature that Buttons currently offers.

    Allan

This discussion has been closed.