Exporting to Excel with filter drop downs results in every filter being in each column title

Exporting to Excel with filter drop downs results in every filter being in each column title

tbithelltbithell Posts: 13Questions: 3Answers: 1

http://live.datatables.net/zekohabi/1/edit?html,css,js,output

I really like that I can pretty simply add the filter drop downs and they work really well. It does have one side effect that my users have asked me to look into. When I export to excel I the column headers have every value from the dropdowns in them. Logically, it makes sense that it does that, so I don't think this is a bug, but instead I need to do something on my end. What I'm stuck on is what exactly it is that I need to do.

Any help will be much appreciated.

Answers

  • tbithelltbithell Posts: 13Questions: 3Answers: 1
    edited December 2015

    I tried adding this, and while it formats the data how I'd like it formatted it doesn't add it to the header row. I feel like I'm close.

    var data = table.buttons.exportData( {
    "format":{
    "header": function(data)
    {

                        var test = data.substring(0, data.indexOf(':'));
                        var test2 = test.split(">");
                        console.log(test2[1]);
                        return test;
                    }
                }
        });
    
  • tbithelltbithell Posts: 13Questions: 3Answers: 1

    This was answered via this post... I as unaware they were related...

    http://datatables.net/forums/discussion/comment/86594#Comment_86594

This discussion has been closed.