RealGrid2 API
Interface
UserExportCell

UserExportCell

엑셀로 export할때 그리드가 출력하는 내용외에 추가적으로 출력할 내용을 지정한다.

Signature:

export interface UserExportCell 

Remarks

그리드가 출력하는 영역을 덮어쓰는 경우 엑셀파일에 오류가 발생할수 있기 때문에 주의해야 한다. row, col, value는 반드시 지정해야 한다.

Example

var userCells = [
 {row: 0, col: 0, value: "사용자 입력문자열"},
 {row: 1, col: 0, styleName: "userCellRed", value: "스타일을 적용"},
 {row: 2, col: 0, mergeRow: 1, mergeCol: 3, styleName: "userCellRed", value: "merge를 하고 스타일을 적용."},
 {row: 3, col: 0, value: "inline-style", styles: {background:"red", fontSize:"20px"}},
 {row: 4, col: 0, value: 12345, format: "#,##0.0_ ", styles: {textAlign:"right"}},
 {row: 4, col: 2, value: new Date(2022, 4, 16), format: "[$-F800]dddd, mmmm dd, yyyy", styles: {textAlign:"center"}},
]
gridView.exportGrid({"type": "excel", "target": "local", "yOffset": 5, "userCells": userCells});

Properties

PropertyModifiersTypeDescription
cellProtectPropsCellProtectProperties
colnumber출력될 컬럼번호 0부터 계산된다.
formatstring셀에 적용될 format을 입력한다.
heightnumber행의 높이를 지정한다.
heightsnumber[]mergeRow가 있는 경우 각행의 높이를 지정한다.
imageUserCellImage | string셀에 이미지를 추가한다. 이미지는 셀(병합된경우 포함)보다 크게 표시될수 없다.
mergeColnumbermerge할 경우 컬럼갯수
mergeRownumbermerge할 경우 row갯수
rownumber출력될 행번호 0부터 계산된다.
styleNamestring셀에 적용될 className
stylesConfigObject | string셀에 적용될 스타일
valueany출력될 내용

Properties Desc

cellProtectProps

Remarks:

잠금

col

출력될 컬럼번호 0부터 계산된다.

format

셀에 적용될 format을 입력한다.

height

행의 높이를 지정한다.

Remarks:

이미 출력된 행에 추가되는 경우 출력행의 높이를 유지한다.

heights

mergeRow가 있는 경우 각행의 높이를 지정한다.

Remarks:

지정하지 않으면 height가 적용된다.

image

셀에 이미지를 추가한다. 이미지는 셀(병합된경우 포함)보다 크게 표시될수 없다.

Remarks:

string으로 입력하면 이미지를 가운데 정렬해서 출력한다.

mergeCol

merge할 경우 컬럼갯수

mergeRow

merge할 경우 row갯수

row

출력될 행번호 0부터 계산된다.

styleName

셀에 적용될 className

styles

셀에 적용될 스타일

Example:

var styles = {
    textAlign: "center",
    background: "green",
    color: "red"
}
 
var styles2 = "text-align:center;background:green;color:red"

value

출력될 내용

Remarks:

string, numbar, Date, boolean 형태의 값을 입력한다.