How to export multiple table to one file excel?

Hello webix team, your the best team ever!

I’m having trouble on exporting tables to excel. In my project I have a lot of table, but the export function just support to export each table at once. Can I just let it combine all the table and export it? Or are there some workaround to do this (like maybe combining all the table and then export it)?

Here the snippet http://webix.com/snippet/e2027a97

You can use webix.DataCollection to gather all the data, and then export it:

http://webix.com/snippet/07909bc3

Thank you, that’s helpful. I just realize that my tables are actually binded to a treetabel like this snippet http://webix.com/snippet/3c5d6a1c

What do you think? Should I loop to concat it? Do you have better method?

Btw how to print treetable name? It’s all written in div’s… Can I format it?

It is a bit beyond current export functionality.

If you have a support subscription, please contact us by email. I think we can extend the existing functionality, so it will be possible to combine multiple tables ( as multiple pages ) in the export file.

I’m sorry, I’m still in college, and this is my essay. I hope one day I’ll buy webix if this project get successful. Maybe I’ll try to do the select-serialize loop.

I’ll post it here if I succeeded. Thanks for your help guys…

Check webix_debug.js and locate toExcel method. You can try to patch it.

There are two kind of code block here

        //this one need to be called to each exported grid
        var scheme = getExportScheme(view, options);
        var result = getExportData(view, options, scheme);
        var data   = getExcelData(result, scheme);
        //this one inited once
        var wb = { SheetNames:[], Sheets:[]};
        //and this one again for each involved grid
        var name = options.name || "Data";
        wb.SheetNames.push(name);
        wb.Sheets[name] = data;

Thank you for your suggestion, Maksim.

What exactly I need is to combine all the datatable only. So the solution is near like this http://webix.com/snippet/30d5e85f

But the problem is that it wont export to Excel. I did exactly like snippet from Listopad. Snippet from Listopad with some data modifying http://webix.com/snippet/48f79b9f . Even the array of object look similar.

Do you know why its error?

Guys… I made it.

After all it just that I have to define which column I want to export

Here is the snippet http://webix.com/snippet/89352c6a

Thank you and have a nice day guys… :slight_smile:

Btw, here is the final snippet http://webix.com/snippet/0fbeaefd

It includes tree name so you can refer which item has the table.