I want to display Export Excel with header ,Footer,image and Execution date using datatable

I want to display Export Excel with header ,Footer,image and Execution date using datatable

ajit Kumarajit Kumar Posts: 2Questions: 1Answers: 0

Plz any body help me i m trying last one week but did'nt got any solution.

Answers

  • ajit Kumarajit Kumar Posts: 2Questions: 1Answers: 0

    I want to display Execution Date in Excel........
    My Code is...
    var tableToExcel = (function () {
    var uri = 'data:application/vnd.ms-excel;base64,'
    , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head></head><body>

    {table}

    </body></html>'
    , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
    , format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
    return function (table, name) {

                        if (!table.nodeType) table = document.getElementById(table)
                        var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
                        tab_text += "<colgroup><caption>Alert Exception Report</caption>";
    
                        for (j = 0 ; j < table.rows.length ; j++) {
                            tab_text = tab_text + table.rows[j].innerHTML + "</tr>";
                            //tab_text=tab_text+"</tr>";
                        }
                        var div = document.createElement('div');
                        div.innerHTML = tab_text;
    
                        var ctx = { worksheet: name || 'Worksheet', table: div.innerHTML }
                        window.location.href = uri + base64(format(template, ctx))
                    }
                })()
    
  • allanallan Posts: 62,120Questions: 1Answers: 10,186 Site admin

    I'm afraid you'll need to clarify your question What execution date? I don't see any date code in the code you pasted above.

    Allan

This discussion has been closed.