Click here to Skip to main content
14,868,570 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi i am trying to add export excel button to my table here is my code:
<script src="vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet" type="text/css" />
<script type="text/javascript" >
    $(function () {
            type: "POST",
            url: "daily.aspx/GetCustomers",
            data: '{}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: OnSuccess,
            failure: function (response) {
            error: function (response) {
    function OnSuccess(response) {
                "sScrollX": "100%",
                "bScrollCollapse": true,
                scrollY: "100%",
                bLengthChange: true,
                lengthMenu: [[5, 10,20, -1], [5, 10,20, "All"]],
                bFilter: true,
                bSort: true,
                bPaginate: true,
                data: response.d,
                columns: [{ 'data': 'sitecode' },
                    { 'data': 'siteid' },
                    { 'data': 'region' }]

What I have tried:

i tried to add
buttons: [

in side the function
function OnSuccess(response) {

but it doesnt work
Gerry Schmitz 7-Mar-21 14:32pm
Get the user to "import" (html tables) using their Excel. It does a better job than you could ever hope to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900