Search code examples
javascriptexport-to-exceltabulator

How to hide topCalc row when exporting to Excel


In my webpage there is a Tabulator 4.9 table with a row of calculated values added to the top, resulting from the spec topCalc:"sum". I have also added a button to export the table to Excel and this works fine. However, in the Excel file I do not want the summation row to be present.

I can of course remove that row in Excel, but I prefer to not export it at all from the Tabulator table. I have tried to remove the row using filters, but that has not been successful.

Is there an elegant way to hide a row of calculated values for the export to Excel?


Solution

  • Try using columnCalcs: false for the table's downloadConfig property. For example:

    var table = new Tabulator("#example-table", {
      downloadConfig:{
        columnCalcs: false
      }
    })
    

    http://tabulator.info/docs/4.9/download#new-tab