如何使用ALASQL和XLSX设置自定义标题名称

我正在使用angularalasqlxlsx将一些表导出为ex​​cel。 我使用它如下:

var options = { headers: true, sheetid: 'users', columns: [{ columnid: 'a', title: 'Username' }, { columnid: 'b', title: 'First name' }, { columnid: 'c', title: 'Last name' }] }; alasql('SELECT * INTO XLSX("test.xlsx", ?) FROM ?', [options, $scope.users]); 

我期待columnns选项自定义我的表头。 但是这不是在做。

任何线索为什么?

有时候,你想使用包括空格(分隔符)或…使用标题是保留字(删除),在这两种情况下,你可以使用[]像这样:

 alasql('SELECT firstName AS FirstName, [Deleted] AS [Erased], Separated AS [Separated By] INTO XLSX("test.xlsx", ?) FROM ?', [options, $scope.users]); 

我设法通过使用普通的SQL自定义标题:

 alasql('SELECT firstName AS FirstName INTO XLSX("test.xlsx", ?) FROM ?', [options, $scope.users]); 

这工作,firstName头是名字。