Blazor Tree Grid Export to Excel Service

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

    Blazor Excel Exporter Example

    Export Multi Column Headers Grid

    It is now possible to export IgbTreeGrid with defined multi-column headers. All headers will be reflected in the exported excel file as they are displayed in the IgbTreeGrid. 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 IgbTreeGrid will 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.

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

    Known Limitations

    Limitación Descripción
    Niveles de jerarquía El servicio exportador de Excel puede crear hasta 8 niveles de jerarquía.
    Tamaño máximo de hoja de trabajo El tamaño máximo de hoja de cálculo admitido por Excel es 1.048.576 filas por 16.384 columnas.
    Estilo celular El servicio de exportación de Excel no admite la exportación de un estilo personalizado aplicado a un componente de celda. En tales escenarios, recomendamos utilizar la Biblioteca de Excel.

    API References

    • ExcelExporterService
    • ExcelExporterOptions
    • IgbTreeGrid

    Additional Resources

    Nuestra comunidad es activa y siempre da la bienvenida a nuevas ideas.