NEW VERSION RELEASED! Webix 11 Read More Core Updates, Extended Functionalities in SpreadSheet and File Manager and more

Data Export from Pivot, JavaScript Programming Example of Data Export from Pivot

Data Export from Pivot

Get the programming example below to ensure export of data from Pivot in different formats. Seize the opportunity to use our free coding samples for your web applications.

JS Code

webix.ready(function() {
  webix.CustomScroll.init();

  webix.ui({
    rows: [
      {
        cols: [
          {
            view: "button",
            label: "Export to PDF",
            click: () =>
            webix.toPDF("pivot", {
              autowidth: true,
              styles: true,
            }),
          },
          {
            view: "button",
            label: "Export to Excel",
            click: () => webix.toExcel("pivot", { styles: true, spans: true }),
          },
          {
            view: "button",
            label: "Export to CSV",
            click: () => webix.toCSV("pivot"),
          },
          {
            view: "button",
            label: "Export to PNG",
            click: () => webix.toPNG("pivot"),
          },
        ],
      },
      {
        view: "pivot",
        id: "pivot",
        structure: {
          rows: ["form", "name"],
          columns: ["year"],
          values: [{ name: "oil", operation: ["max", "sum"] }],
        },
        url: "https://cdn.webix.com/demodata/pivot.json",
      },
    ],
  });
});