# importDataFromXlsx

파일 바이트를 워크북으로 파싱합니다. 반환값은 XlsxImportResult이며 Grid용 snapshot은 xlsxImported 이벤트에서 읽습니다.

Canonical: https://grid.syidax.com/ko/docs/methods/importDataFromXlsx/

<a id="meaning"></a>

## 무엇을 하는 API인가요

파일 바이트를 워크북으로 파싱합니다. 반환값은 XlsxImportResult이며 Grid용 snapshot은 xlsxImported 이벤트에서 읽습니다.

<a id="contract"></a>

## 입력과 결과의 정확한 타입

```typescript
importDataFromXlsx(source: ArrayBuffer | Uint8Array, options?: { sheetName?: string; snapshot?: SheetToRowDataOptions }): Promise<XlsxImportResult>
```

| 인수 | 필수 여부 | 타입 |
| --- | --- | --- |
| source | 필수 | ArrayBuffer \| Uint8Array |
| options | 선택 | { sheetName?: string; snapshot?: SheetToRowDataOptions } |

반환 타입은 `Promise<XlsxImportResult>`입니다.

<a id="usage"></a>

## 사용 흐름

등록과 초기화를 마친 Grid 요소에서 grid.importDataFromXlsx(…)를 호출합니다. 반환값은 await로 읽으세요. boolean이나 보고서를 반환하는 메서드는 결과를 확인한 뒤 다음 작업을 진행합니다.

<a id="types"></a>

## 관련 타입 읽기

- [SheetToRowDataOptions](https://grid.syidax.com/ko/docs/types/SheetToRowDataOptions.md)
- [XlsxImportResult](https://grid.syidax.com/ko/docs/types/XlsxImportResult.md)

<a id="recipes"></a>

## 기능별 설명과 예제

- [Excel 가져오기](https://grid.syidax.com/ko/docs/features/xlsx-import.md) — XLSX 가져오기는 파일을 워크북으로 읽고 선택한 시트를 Grid용 열·행 스냅샷으로 변환합니다. 워크북 전체 파싱 결과와 화면용 스냅샷은 다른 데이터입니다.
