EzExcel

EzExcel

엑셀 다운로드 유틸 객체
팩토리 함수 excel을 호출해 생성합니다.

Methods

export(exportInfo) → {Promise}

Description:
  • Grid의 내용을 excel파일화 한다.

Example
this.excel.export({
  comp : this.Grid00,
  fileNm : "test",
  delColumns : ["CHK"],
  exportHead : "allband",
  exportSelect : "allrecord",
  exportMerge : "suppress",
  exportValue :"allstyle",
  exportImage : "none",
  exceptStyle : "background",
  exportSize : "width",
  cfn : "fn_callback"
})
Parameters:
Name Type Description
exportInfo EzExcel.ExcelExportInfo

excel export 정보 객체

Returns:

후처리용 Promise 파라미터로 nexacro.ExcelExportEventInfo 를 받음

Type
Promise

import(importInfo) → {Promise}

Description:
  • Excel파일의 내용을 import해 dataset에 반영한다.

Example
this.excel.import({
  comp : this.Dataset00,
  body : "Sheet1!A2",
  columns : {
    0 : "COL1",
    1 : "COL2",
  },
  cfn : "fn_callback"
})
Parameters:
Name Type Description
importInfo EzExcel.ExcelImportInfo

excel - Import 정보를 담은 Object

Returns:

후처리용 Promise 파라미터로 nexacro.ExcelImportEventInfo 를 받음

Type
Promise

Type Definitions

ExcelExportCfnParam

Description:
  • ExcelExport 완료 혹은 실패시 실행될 콜백 함수에 전달될 파라미터의 형식

Properties:
Name Type Description
e nexacro.ExcelExportEventInfo

export 시도 결과 이벤트 객체

Properties
Name Type Description
gridName string

export를 시도한 Grid 명

code string

export를 시도 결과 code

form nexacro.FormBase

EzExcel이 속한 form

controller EzExcel

export에 사용한 EzExcel 객체

ExcelExport 완료 혹은 실패시 실행될 콜백 함수에 전달될 파라미터의 형식

Type:
  • Object

ExcelExportInfo

Description:
  • 엑셀 Export 옵션 정보

Properties:
Name Type Attributes Default Description
comp nexacro.Grid

excel로 export할 내용을 담은 컴포넌트

fileNm string <optional>
'untitled'

exprot할 파일의 명칭

delColumns Array.<string> | Array.<number> <optional>

export시 제외할 칼럼명 또는 칼럼 index의 배열

exportHead "allband" | "nohead" | "nosumm" | "nohead,nosumm" <optional>

Grid Head, Summary영역 export방식 설정 exportSelect가 "allrecord"일 경우 default값은 "allband" exportSelect가 "selectrecord"일 경우 default값은 "nohead,nosumm"

  • allband : Head, Summary 영역을 모두 Export
  • nohead : Head 영역을 Export에서 제외합니다.
  • nosumm : Summary 영역을 Export에서 제외합니다.
exportSelect "allrecord" | "selectrecord" <optional>
"allrecord"

Grid 선택영역 export방식 설정

  • allrecord : 모든 row를 export
  • selectrecord : 선택된 row만 export
exportMerge "suppress" | "nosuppress" <optional>
"suppress"

suppress 속성이 설정된 cell의 export방식 설정

  • suppress : suppress결과대로 1개의 cell만 출력
  • nosuppress : suppress결과를 무시하고 각 row에 export
exportValue "allstyle" | "selectstyle" <optional>
'allstyle'

선택된 영역 출력방식 설정

  • allstyle : 선택에 의해 변경된 속성 무시
  • selectstyle : 선택에 의해 변경된 속성 적용
exportImage "none" | "url" | "image" <optional>
'none'

Cell에 설정된 이미지의 export방식 설정

  • none : 이미지 없이 export
  • url : 이미지의 URL정보를 export
  • image : 이미지를 첨부하여 export
exceptStyle "none" | "align" | "background" | "color" | "font" | "border" <optional>
'background,color'

export시 제외할 CSS 속성 설정, ","를 구분자로 여러옵션 선택 가능

  • none : 제외 속성 없음
  • align : -nexa-text-align, -nexa-vertical-align 제외
  • background : background color 제외
  • color : color 제외
  • font : font 제외
  • border : -nexa-border 제외
exceptSize "width" | "height" | "both" <optional>
'width'

cell의 width, height값을 엑셀에 적용할지 여부

  • width : cell의 너비를 적용해 export
  • height : cell의 높이를 적용해 export
  • both : cell의 너비와 높이를 모두 적용해 export
exportfilepassword string

다운로드시 비밀번호

cfn string <optional>

콜백함수 명, 파라미터양식은 여기를 참조하세요

엑셀 Export 옵션 정보

Type:
  • Object
Example
{
  comp : this.Grid00,
  fileNm : "test",
  delColumns : ["CHK"],
  exportHead : "allband",
  exportSelect : "allrecord",
  exportMerge : "suppress",
  exportValue :"allstyle",
  exportImage : "none",
  exceptStyle : "background,color",
  exportSize : "width",
  cfn : "fn_callback"
}

ExcelImportCfnParam

Description:
  • ExcelImport 완료 혹은 실패시 실행될 콜백 함수에 전달될 파라미터의 형식

Properties:
Name Type Description
importInfo.cfn.e nexacro.ExcelImportEventInfo

import 시도 결과 이벤트 객체

Properties
Name Type Description
datasetName string

import를 시도한 Dataset 명

code string

import 시도 결과 code

form nexacro.FormBase

EzExcel이 속한 form

controller EzExcel

import에 사용한 EzExcel 객체

ExcelImport 완료 혹은 실패시 실행될 콜백 함수에 전달될 파라미터의 형식

Type:

ExcelImportInfo

Description:
  • 엑셀 Import 옵션 정보

Properties:
Name Type Attributes Default Description
comp nexacro.Dataset

읽어들인 내용을 반영할 dataset

body string <optional>
"Sheet1!A2"

excel파일로 부터 읽어올 영역

cfn string <optional>

콜백함수명, 파라미터양식은 여기를 참조하세요

엑셀 Import 옵션 정보

Type:
  • Object
Example
{
  comp : this.Dataset00,
  body : "Sheet1!A2",
  columns : {
    0 : "COL1",
    1 : "COL2",
  },
  cfn : "fn_callback"
}