In my angular controller i have ExportToExcel function, which is using alasql to export data to Excel and the data is coming from angular array. The issue is the array might contains null as data, is it a way to replace null to empty string in alasql
Following is the function
ac.ExportToExcel = function () {
var time = new Date().toJSON().slice(0, 10);
alasql('SELECT * INTO XLSX("ExchangeReport' + time + '.xlsx",{headers:true}) FROM ? WHERE BillingPeriod = "' + ac.ExchangeReport.BillingPeriod + '" or "' + ac.ExchangeReport.BillingPeriod + '" = "" ', [ac.ExchangeDatas]);
}
And this is my data source
ac.ExchangeDatas = [];
from
ac.GetAllExchangeData = function () {
AccountRepository.GetAllExchangeData().$promise.then(
function (data) {
ac.ExchangeDatas = data.result;
},
function (err) {
console.log("error in GetAllExchangeData : " + err);
}
);
}
Data in excel: