React Grid를 Excel 서비스로 내보내기
The Ignite UI for React Export to Excel Service in React Grid can export data to excel. The data export functionality is encapsulated in the ExcelExporterService class and the data is exported in MS Excel table format. This format allows features like filtering, sorting, etc. To do this you need to invoke the Export method of ExcelExporterService and pass the IgrGrid component as first argument to export grid easily.
React Excel Exporter Example
Export Grouped Data
To export grouped data you just need to group the IgrGrid by one or more columns. The browser will download a file named "ExportedDataFile.xlsx" which contains the data from the IgrGrid component in MS Excel format grouped by the selected column. You can find example in the beginning of the topic.
Export Multi Column Headers Grid
It is now possible to export IgrGrid with defined multi-column headers. All headers will be reflected in the exported excel file as they are displayed in the IgrGrid. If you want to exclude the defined multi-column headers from the exported data you can set the ExporterOption IgnoreMultiColumnHeaders to true.
[!Note] The exported
IgrGridwill not be formatted as a table, since Excel tables do not support multiple column headers.
Export Grid with Frozen Column Headers
By default Excel Exporter service exports the grid with scrollable (unfrozen) column headers. There are scenarios in which you may want to freeze all headers on top of the exported excel file so they always stay in view as the user scrolls through the records. To achieve this you could set the ExporterOption FreezeHeaders to true.
function exportEventFreezeHeaders(args: IgrExporterEventArgs) {
args.detail.options.freezeHeaders = true;
}
<IgrGridToolbar>
<IgrGridToolbarActions>
<IgrGridToolbarExporter onExportStarted={exportEventFreezeHeaders}></IgrGridToolbarExporter>
</IgrGridToolbarActions>
</IgrGridToolbar>
Known Limitations
| 한정 | 설명 |
|---|---|
| 최대 워크시트 크기 | Excel에서 지원되는 최대 워크시트 크기는 1,048,576행 x 16,384열입니다. |
| 셀 스타일링 | Excel 내보내기 서비스는 셀 구성 요소에 적용된 사용자 정의 스타일 내보내기를 지원하지 않습니다. 이러한 시나리오에서는 Excel 라이브러리를 사용하는 것이 좋습니다. |
API References
ExcelExporterServiceExcelExporterOptionsIgrGrid
Additional Resources
우리 커뮤니티는 활동적이며 항상 새로운 아이디어를 환영합니다.