In jQuery DataTable, Export to excel showing error Uncaught Error: Syntax error, unrecognized expres

In jQuery DataTable, Export to excel showing error Uncaught Error: Syntax error, unrecognized expres

madhav1460madhav1460 Posts: 2Questions: 0Answers: 0

I am using export to excel but showing error

Uncaught Error: Syntax error, unrecognized expression: Dosa Palta (Griller Slicer)

Replies

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Do you have customization code for the Excel export button?

    Please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • madhav1460madhav1460 Posts: 2Questions: 0Answers: 0

    sir, I did not use customize code
    $('#tbllist').dataTable({
    "columnDefs": [{ targets: 'no-sort', orderable: false, "order": [] }],
    "lengthChange": false,
    "scrollY": "350px",
    //"scrollCollapse": true,
    "paging": false,
    destroy: true,
    dom: 'Bfrtip',
    buttons: [
    $.extend(true, {}, buttonCommon, {
    extend: 'pdfHtml5', filename: 'ItemListView', className: "btn btn-primary", text: 'Export to PDF', title:"Item List View",
    exportOptions: {columns: [1,2,3,4],}
    }),
    $.extend(true, {}, buttonCommon, {
    //extend: 'excelHtml5', filename: 'ItemListView', className: "btn btn-success", text: 'Export to Excel', text: 'Export to Excel',messageTop: 'The information in this table is copyright to PI-Infotech.com',title: function () { return getExportTitle();},
    extend: 'excelHtml5', filename: 'ItemListView', className: "btn btn-success", text: 'Export to Excel', text: 'Export to Excel',messageTop: 'The information in this table is copyright to PI-Infotech.com', title:"Item List View",
    exportOptions: {columns: [1,2,3,4],}
    }),
    $.extend(true, {}, buttonCommon, {
    extend: 'print', filename: 'ItemListView', className: "btn btn-info", title:"Item List View",
    exportOptions: {columns: [1,2,3,4],}
    }),
    ],

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    As Kevin said, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    In the error it points to line 443 of your List script. What is on that line?

    You have $.extend(true, {}, buttonCommon, {. What does configuration does the buttonCommon variable contain?

    In order to help debug we will need to see the issue. Please post a link to your paage or a test case replicating the issue.

    Kevin

This discussion has been closed.