how to Column cut export excel ?

how to Column cut export excel ?

deengpddeengpd Posts: 1Questions: 1Answers: 0

Answers

  • rf1234rf1234 Posts: 2,950Questions: 87Answers: 416
    edited September 2020

    Here is something on copying and pasting content - and many other things regarding Excel export customization.
    https://datatables.net/forums/discussion/45846/datatable-excel-export-how-can-we-apply-multiple-styles-to-same-cell/p1

    This is part of the customization code which does something similar to what you want to achieve:

    // move text from column B to column A and 
    // empty columns B through E
    var copyPaste = $('row:eq(-2) c[r^="B"] t', sheet).text();
    $('row:eq(-2) c[r^="A"] t', sheet).text(copyPaste);
    var emptyCellCols = ['B', 'C', 'D', 'E'];
    for ( i=0; i < emptyCellCols.length; i++ ) {
        $('row:eq(-2) c[r^='+emptyCellCols[i]+']', sheet).text('');
    }
    
This discussion has been closed.