Custom header for excel export

Hi,

I am working with webix.toExcel method and i am finding it difficult to apply custom style on excel header. I need to bold my header column names, but generally I would like to apply some css class for header column names.
Is that possible?

I did research, but I couldn’t find any information I could use to solve my problem.

Thanks

Hello,

Did you try this?

webix.toExcel($$("table"), {
    styles:true
});

Yeah, but if I do that then all styles in that datatable that I am trying to export will be applied in excel. I want datatable to be exported just like it is exported when there is styles: false, but only with one change - i want to apply style on header columns names.

So, I need to write styles: true, and then to remove all styles applied on datatable, and then to add my own css class in some place. :neutral:

You can solve it with the help of $exportView
Sample: https://snippet.webix.com/wghkjuwt

Wow, that works.

Thank you very much. :slight_smile:

My datatable has filters and when I export it to excel, there is one empty row between headers with columns names and data.

I am guessing that it is because of filters in datatable, because when I hide all of them, there is no empty row anymore.

Is there any property on webix.toExcel method that can remove those filters from final document? Can’t find any.

One way is to create on the fly exactly same datatable, except filters in that datatable, and to export that datatable, but that is ugly solution.

Hi,

You can specify the columns as described here

Please check this sample https://snippet.webix.com/ocs1ra4q

Thanks, this was very helpful.