Hello!
I tried to integrate survey analytics tabulator functionality to try out its excel export feature, however it is not working. Once I click on the Excel button, the following error is occurring in console:
errors.ts:30 ERROR ReferenceError: XLSX is not defined
at Tabulator.xlsx (tabulator.es2015.js:11928)
at Download…/node_modules/tabulator-tables/dist/js/tabulator.es2015.js.Download.download (tabulator.es2015.js:11636)
at Tabulator…/node_modules/tabulator-tables/dist/js/tabulator.es2015.js.Tabulator.download (tabulator.es2015.js:8884)
at Tabulator…/src/tables/tabulator.ts.Tabulator.download (tabulator.ts:397)
at HTMLButtonElement.onclick [as __zone_symbol__ON_PROPERTYclick] (tabulator.ts:157)
at HTMLButtonElement.wrapFn (zone.js?v=2IeQSCTDsAy5mjNmNhsdJZSpJxOKEV1VNZLMjf6LfFc:798)
at ZoneDelegate.invokeTask (zone.js?v=2IeQSCTDsAy5mjNmNhsdJZSpJxOKEV1VNZLMjf6LfFc:429)
at Object.onInvokeTask (ng_zone.ts:293)
at ZoneDelegate.invokeTask (zone.js?v=2IeQSCTDsAy5mjNmNhsdJZSpJxOKEV1VNZLMjf6LfFc:428)
at Zone.runTask (zone.js?v=2IeQSCTDsAy5mjNmNhsdJZSpJxOKEV1VNZLMjf6LfFc:200)
The project is in angular, I was using this tutorial:
https://surveyjs.io/Examples/Analytics?id=nps-tabulator&platform=Angular&theme=modern#content-result
Survey js Analytics version - 1.9.
My code sample:
Codeimport { Tabulator } from 'survey-analytics/survey.analytics.tabulator';
Codevar survey = new Survey.Model(this.analytics.body);
var surveyResultNode = document.getElementById('surveyResult');
surveyResultNode.innerHTML = '';
var options = {
haveCommercialLicense: true
};
var surveyAnalyticsTabulator = new Tabulator(survey, this.analytics.answers, options);
surveyAnalyticsTabulator.render(surveyResultNode);
Are there any additional set-ups needed?
Will appreciate any help with the issue.
Thanks!