print

print

mailbothramailbothra Posts: 12Questions: 4Answers: 0
edited September 2016 in General

buttons: [

        {
            extend: 'print',
            customize: function (win) {

                myprint(win)
            },

            text: 'Export',
            buttons: [
                'copy',
                'excel',
                'csv',
                'pdf',
                'print'
            ]
        }
        ],

if i extend print i cant use other options like pdf excel extra , any work around?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    It looks like you have a buttons property inside the print button. That isn't something that the print button will do anything with. I think you might mean:

    buttons: [{
        extend: 'print',
        customize: function(win) {
            myprint(win)
        }
    }, {
        extend: 'collection',
        text: 'Export',
        buttons: [
            'copy',
            'excel',
            'csv',
            'pdf',
            'print'
        ]
    }],
    

    Allan

  • mailbothramailbothra Posts: 12Questions: 4Answers: 0
    edited September 2016

    hi
    thanks for your quick reply , its working fine.
    I have a question if I want to write my own printing function bypassing the default one then how can I get the column names and all the rows.

    do you suggest any plugin or method to write the printing methods because I need heavy customization --- thanks

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    how can I get the column names and all the rows.

    buttons.exportData().

    do you suggest any plugin or method to write the printing methods because I need heavy customization

    Sorry no. Perhaps write your own if it needs to be heavily customised.

    Allan

  • mailbothramailbothra Posts: 12Questions: 4Answers: 0

    can we extend excel same like print?
    I want to add some data while exporting to excel

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Yes, use the customize method of the excelHtml5 button type. You need to modify the XSLX file that is created, so it isn't trivial, but it is quite possible.

    Allan

This discussion has been closed.