React Hierarchical Grid Export to Excel Service

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

    React Excel Exporter Example

    EXAMPLE
    TSX
    CSS

    Like this sample? Get access to our complete Ignite UI for React toolkit and start building your own apps in minutes. Download it for free.

    Export Multi Column Headers Grid

    It is now possible to export IgrHierarchicalGrid with defined multi-column headers. All headers will be reflected in the exported excel file as they are displayed in the IgrHierarchicalGrid. If you want to exclude the defined multi-column headers from the exported data you can set the ExporterOption IgnoreMultiColumnHeaders to true.

    The exported IgrHierarchicalGrid will not be formatted as a table, since Excel tables do not support multiple column headers.

    EXAMPLE
    TSX
    CSS

    Ignite UI for React | CTA Banner

    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(grid: IgrGridBaseDirective, args: IgrExporterEvent) {
        args.detail.options.freezeHeaders = true;
    }
    
    <IgrGridToolbar key="toolbar">
      <IgrGridToolbarActions key="toolbarActions">
        <IgrGridToolbarExporter key="exporting" exportStarted={exportEventFreezeHeaders}></IgrGridToolbarExporter>
      </IgrGridToolbarActions>
    </IgrGridToolbar>
    tsx

    Known Limitations

    Limitation Description
    Hierarchy levels The excel exporter service can create up to 8 levels of hierarchy.
    Max worksheet size The maximum worksheet size supported by Excel is 1,048,576 rows by 16,384 columns.
    Exporting pinned columns In the exported Excel file, the pinned columns will not be frozen but will be displayed in the same order as they appear in the grid.

    API References

    Additional Resources

    Our community is active and always welcoming to new ideas.