请问GC.Spread.Excel.IO 可以从ArrayBuffer或者blob中导入么?我们的程序调用 c# WEB API 读取excel文件。目前的前端是直接将结果保存,代码如下:
function angularcall(projectdata) {
angular.module('main.app', []).factory('CaculateService', ['$http', function ($http) {
return new function () {
this.DoCalculate = function () {
$http.post("/api/ReadExcel/", projectdata, { responseType: 'arraybuffer' })
.success(function (data) {
var file = new Blob([data], { type: 'application/vnd.ms-excel.sheet.macroEnabled.12' });
var fileURL = URL.createObjectURL(file);
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(file);
}
else {
window.open(fileURL);
}
}
)
.error(function (data, status, header, config) {
encodedString = String.fromCharCode.apply(null, Uint8Array(data)),
decodedString = decodeURIComponent(escape(encodedString));
alert("计算出错: " + decodedString);
})
}
};
}]);
angular.injector(['ng', 'main.app']).get("CaculateService").DoCalculate();
}
请问如何将 上述代码中的arraybuffer或者Blob导入到spreadjs中?
|
|