Export to PNG

To export data from datatable or treetable into a PNG file, you need to call the toPNG method. The method takes the following parameters:

  • id - (string) the id of the exported view
  • name - (string) optional, the name of the created PNG file

For example, if you want to export a datatable to a PNG file, you need to initialize a datatable:

{
    view:"datatable",
    id: "myDataTable",
    // datatable configuration
    ...
}

and then call the toPNG() method with the datatable id as its parameter:

webix.toPNG($$("myDataTable"));

Related sample:  Export to PNG

Customizing Export to PNG

You can customize the default export settings in the following way:

  • disable file download if necessary, via the download property set to false:
webix.toPNG($$("table"), {
   download:false
}).then(function(blob){
   //process raw data
});
  • ignore particular columns during export via the ignore property. You need to set its value as an object with a list of columns names to ignore. For example:
webix.toPNG($$("table"), {
    ignore: { "votes":true, "rating":true }
});
Back to top
If you have not checked yet, be sure to visit site of our main product Webix web control library and page of javascript datatables product.