PureJS 출력 관련2
페이지 정보
작성자 그대란이름 작성일 2021-11-08 14:26 조회 1,719회 댓글 0건본문
관련링크
커스텀 함수 적용하여 출력시 셀 내용이 "#NAME?" 으로 나오는 현상입니다.
확인 부탁드립니다.
// 커스텀 함수 선언
function GetTest() {
this.name = "getTest";
this.maxArgs = 10;
this.minArgs = 1;
}
GetTest.prototype = new GC.Spread.CalcEngine.Functions.Function();
GetTest.prototype.evaluate = function (arg) {
var result = "";
var param = {arg:arg };
$.getSync("/test/test", param, function(data){
result = data["value_"];
});
return result;
};
// 시트에 함수 적용
var sheet = spread.getActiveSheet();
var getTest = new GetTest();
sheet.addCustomFunction(getTest);
sheet.setFormula(row, col, 'getTest("test1")');
sheet.setFormula(row, col, 'getTest("test2")');
// 출력
var excelIo = new GC.Spread.Excel.IO();
var json = spread.toJSON();
//var json = JSON.stringify(spread.toJSON({includeBindingSource: true}))
excelIo.save(json, function (blob) {
saveAs(blob, fileName);
}, function (e) {
// process error
console.log(e);
});
댓글목록
등록된 댓글이 없습니다.