Web Components 계층적 그리드를 Excel 서비스로 내보내기
The Ignite UI for Web Components Export to Excel Service in Web Components Hierarchical 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 IgcHierarchicalGridComponent component as first argument to export grid easily.
Web Components Excel Exporter Example
Export Multi Column Headers Grid
이제 수출이 가능합니다IgcHierarchicalGridComponent 정의된 경우 다중 열 헤더. 모든 헤더는 내보낸 엑셀 파일에 반영되어IgcHierarchicalGridComponent. 내보내는 데이터에서 정의된 다중 열 헤더를 제외하고 싶다면,ExporterOption IgnoreMultiColumnHeaders 받는 사람true.
[!Note] The exported
IgcHierarchicalGridComponentwill not be formatted as a table, since Excel tables do not support multiple column headers.
Export Grid with Frozen Column Headers
기본적으로 Excel Exporter 서비스는 스크롤 가능한(동결 해제된) 열의 헤더가 포함된 그리드를 내보냅니다. 어떤 경우에는 내보낸 엑셀 파일 위에 모든 헤더를 고정해 사용자가 기록을 스크롤할 때 항상 보이도록 하는 것이 좋습니다. 이를 위해 toExporterOption를 설정할 FreezeHeaderstrue 수 있습니다.
constructor() {
var hGridToolbarExporter = document.getElementById('hGridToolbarExporter') as IgcGridToolbarExporterComponent;
hGridToolbarExporter.addEventListener("exportStarted", this.webGridExportEventFreezeHeaders);
}
public webGridExportEventFreezeHeaders(args: CustomEvent<IgcExporterEvent>): void {
args.detail.options.freezeHeaders = true;
}
Known Limitations
| 한정 | 설명 |
|---|---|
| 계층 수준 | Excel 내보내기 서비스는 최대 8개 수준의 계층 구조를 생성할 수 있습니다. |
| 최대 워크시트 크기 | Excel에서 지원되는 최대 워크시트 크기는 1,048,576행 x 16,384열입니다. |
| 고정된 열 내보내기 | 내보낸 Excel 파일에서 고정된 열은 고정되지 않지만 그리드에 나타나는 것과 동일한 순서로 표시됩니다. |
API References
ExcelExporterServiceExcelExporterOptionsIgcHierarchicalGridComponent
Additional Resources
우리 커뮤니티는 활동적이며 항상 새로운 아이디어를 환영합니다.