Hohulnath v
Hohulnath v

Reputation: 21

formatted data as text while report to excel in datatable,but not working

I have formatted data as text while report to excel in datatable with below code.

"buttons": [{
            extend: 'excel',
            exportOptions: {
                orthogonal: 'sort'
            },
            customizeData: function ( data ) {
                for (var i=0; i<data.body.length; i++){
                    for (var j=0; j<data.body[i].length; j++ ){
                        data.body[i][j] =  data.body[i][j] + '\u200C';
                    }
                }
            }               
            }],

Format data as text when export to excel but, above code included special character(Hidden in Excel, copy cell value and paste to Textpad.exe it has "?" ) My client does not want it. Kindly give me a solution. if any alternate, please provide solution.

Upvotes: 2

Views: 569

Answers (1)

Luis Curado
Luis Curado

Reputation: 756

can u try to remove the '\u200C' char to see what happens ?

i think its because notepad can't handle unicode chars or something like that.

thanks

Upvotes: 1

Related Questions