datatables exportoptions exclude columns code example

Example: how to exclude a field in datatable csv export

dom: 'lBfrtip',
buttons: [
    {
        extend: 'excelHtml5',
        text: '<i class="fa fa-file-excel-o"></i> Excel',
        titleAttr: 'Export to Excel',
        title: 'Insurance Companies',
        exportOptions: {
            columns: ':not(:last-child)',
        }
    },
    {
        extend: 'csvHtml5',
        text: '<i class="fa fa-file-text-o"></i> CSV',
        titleAttr: 'CSV',
        title: 'Insurance Companies',
        exportOptions: {
            columns: ':not(:last-child)',
        }
    },
    {
        extend: 'pdfHtml5',
        text: '<i class="fa fa-file-pdf-o"></i> PDF',
        titleAttr: 'PDF',
        title: 'Insurance Companies',
        exportOptions: {
            columns: ':not(:last-child)',
        },
    },
]