toExcel conflict with custom formatted multi-value column

I must be missing something, but the only commonality between views where my toExcel function “export_table()” does not work all have {view:“search”, …} in the toolbar.

I have created two sample snippets to illustrate my issue:

  • Filter in toolbar, export does not work: Code Snippet
    This view has custom filters in the Toolbar, as well as above the header fields.

  • No filter in toolbar, export works: Code Snippet
    This view has custom filters above the header fields, but not in the toolbar.

Could somebody please take a look and let me know if I am missing some other “simple to fix” element that might get my Export working?

Thanks!

I finally found the source of my inability to Export certain views. It is not related to the Search field at all.

Instead, it appears to be a custom formatted column “Providers” which is causing the toExcel() function to fail without presenting an error:

So, is there a way to either
a) Maintain formatting and still fix the Export,
or
b) Temporarily modify the formatting when the Export button is pressed, restoring it after teh Export process completes?

Thanks, in advance, for any usable suggestions!

Found the problem!

toExcel() does not like the conditional statement I was using in my column formatting function.

Here is an adjusted, working snippet: https://snippet.webix.com/3l7elw4r
(compare to original snippet: https://snippet.webix.com/84k1mstw)

  • On lines 199 & 200 I removed the conditional statements. This required me to convert “val” to an array (in case it wasn’t) so the join could run without error.
  • On line 225 I added “adjustRowHeight” to ensure those rows with more than one Provider are taller than those with one or none.
  • On line 231 I added providers:[“providers”,“sum”] to ensure there was a value for providers on grouped lines where it would normally be missing. Because I use “sum”, there is a null value which can be converted to an array and displays blank values appropriately. (Big-time hack, but it worked)

Hope this helps somebody!