Author Topic: Pivot Grid Export to Excel Problem  (Read 1765 times)

logibricks

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Pivot Grid Export to Excel Problem
« on: December 18, 2018, 01:59:37 pm »
Hello, I am getting this error while exporting the pivot grid.
drreport:1526 Uncaught ReferenceError: saveAs is not defined
    at e.(anonymous function).(anonymous function).listener (http://localhost:63220/report/drreport:1526:29)
    at HTMLButtonElement.<anonymous> (pqgrid.min.js:13)
    at HTMLButtonElement.dispatch (jquery.min.js:3)
    at HTMLButtonElement.r.handle (jquery.min.js:3)

And My code is.
{
                        type: 'button',
                        label: "Export to Excel(xlsx)",
                        icon: 'ui-icon-document',
                        listener: function (evt) {
                            var str = this.exportExcel({ render: true });
                            saveAs(str, "pivot.xlsx");
                        }
                    },

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Pivot Grid Export to Excel Problem
« Reply #1 on: December 18, 2018, 03:27:26 pm »
you need to include FileSaver.js file as mentioned in this demo for local export:

https://paramquery.com/pro/demos/export_local