1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

angular 7 How to export ngx-datatable content to a excel sheet?

Discussão em 'Angular' iniciado por Damian, Maio 28, 2025.

  1. Damian

    Damian Guest

    I have a pb with ngx-datatable and export excel. I try to use fileSaver, with angular 7. I implement a button for export and do this on it :

    var blob = new Blob([document.getElementById("exportable").innerText], {
    type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
    //type: "application/vnd.ms-excel;charset=utf-8"
    });


    then saveAs(blob, "Report.xls");

    "exportable" is the id of ngx-datatable :

    <ngx-datatable id="exportable" #table
    class="mytable"
    [rows]="rows"
    [columns]="columns">


    but I obtain a xls file white one column and all in like this :

    [​IMG]

    do you know how to do to obtain a excel file presentation like my ngx-datatable ?

    Thanks !

    Continue reading...

Compartilhe esta Página