Blazor Grid Export to Excel Service

    The Ignite UI for Blazor Export to Excel Service in Blazor 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 IgbGrid component as first argument to export grid easily.

    Blazor Excel Exporter Example

    Export Grouped Data

    그룹화된 데이터를 내보내려면 하나 이상의 열로 그룹IgbGrid 화하면 됩니다. 브라우저는 "ExportedDataFile.xlsx"라는 이름의 파일을 다운로드하는데, 이 파일은 MS Excel 형식으로 구성된 컴포넌트 데이터를IgbGrid 선택한 열별로 그룹화합니다. 주제 시작 부분에서 예시를 찾을 수 있습니다.

    Export Multi Column Headers Grid

    이제 수출이 가능합니다IgbGrid 정의된 경우 다중 열 헤더. 모든 헤더는 내보낸 엑셀 파일에 반영되어IgbGrid. 내보내는 데이터에서 정의된 다중 열 헤더를 제외하고 싶다면,ExporterOption IgnoreMultiColumnHeaders 받는 사람true.

    [!Note] The exported IgbGrid will 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 수 있습니다.

     <IgbGrid>
        <IgbGridToolbar>
          <IgbGridToolbarActions>
            <IgbGridToolbarExporter
              ExportExcel="true" ExportStartedScript="WebGridExportEventFreezeHeaders">
            </IgbGridToolbarExporter>
          </IgbGridToolbarActions>
        </IgbGridToolbar>
     </IgbGrid>
    
    igRegisterScript("WebGridExportEventFreezeHeaders", (ev) => {
        ev.detail.options.freezeHeaders = false;
    }, false);
    

    Known Limitations

    한정 설명
    최대 워크시트 크기 Excel에서 지원되는 최대 워크시트 크기는 1,048,576행 x 16,384열입니다.
    셀 스타일링 Excel 내보내기 서비스는 셀 구성 요소에 적용된 사용자 정의 스타일 내보내기를 지원하지 않습니다. 이러한 시나리오에서는 Excel 라이브러리를 사용하는 것이 좋습니다.

    API References

    • ExcelExporterService
    • ExcelExporterOptions
    • IgbGrid

    Additional Resources

    우리 커뮤니티는 활동적이며 항상 새로운 아이디어를 환영합니다.