Customize not working in excelHtml5

Customize not working in excelHtml5

Prasanna7Prasanna7 Posts: 8Questions: 4Answers: 0
edited May 2017 in Free community support

Hi Team,

I 'm using excel export for my datatable as per the below code. I cant get the customize option work. If i keep the breakpoint, its not firing into that too. Please help me on this and let me know what am I missing here.

"I need the F column to be right aligned", hence I use customize option to do that.

var buttons = new $.fn.dataTable.Buttons(jobtable, {
        buttons: [
          {
              extend: 'excelHtml5',              
              text: 'Export To Excel',
              customize: function (xlsx) {
                  var sheet = xlsx.xl.worksheets['sheet1.xml'];
                  $('row c[r^="F"]', sheet).attr('s', '52');
              },
              exportOptions: {
                  columns: [':visible'],
                  format: {
                      body: function (data, row, column, node) {
                          if (data.substring(0, 1) === '<') {
                              data = $(data).text();
                          }
                          return data+' ';
                      }
                  },                  
              },
              
          },
        ]
    }).container().insertBefore($('#btnCreate'));

Answers

  • allanallan Posts: 63,892Questions: 1Answers: 10,530 Site admin

    Can you link to a test case showing the issue please.

    Allan

This discussion has been closed.