Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/g-s-c-code/datagridexporter

A lightweight Excel export utility for MudBlazor DataGrid in .NET, enabling simple and efficient spreadsheet generation directly from grid data. Built with OpenXML and JavaScript interop for seamless browser-based file downloads.
https://github.com/g-s-c-code/datagridexporter

blazor csharp dotnet excel-export file-export mudblazor openxml spreadsheet

Last synced: 19 days ago
JSON representation

A lightweight Excel export utility for MudBlazor DataGrid in .NET, enabling simple and efficient spreadsheet generation directly from grid data. Built with OpenXML and JavaScript interop for seamless browser-based file downloads.

Awesome Lists containing this project

README

        

# MudBlazor DataGrid Excel Exporter

## Overview

This library provides Excel export functionality for MudBlazor DataGrid components in .NET applications, allowing easy conversion of grid data into Excel spreadsheets. Link: [datagridexporter.netlify.app](https://datagridexporter.netlify.app/)

## Acknowledgments

This project is substantially based on the work originally developed by [timmac-qmc](https://github.com/timmac-qmc). Credit is given to the original author for the foundational implementation.

## Features

- Easy one-method export for MudBlazor DataGrids
- Supports both simple and extended sheet formats
- Automatic number and text cell type detection
- Configurable column visibility
- Browser-based file download using JavaScript interop

## Installation

### Dependencies
- Microsoft.AspNetCore.Components
- MudBlazor
- DocumentFormat.OpenXml

### Setup
1. Install the required NuGet packages (see dependencies)
2. Copy the project files into your solution
3. Ensure the JavaScript file (`saveFileAs.js`) is included and referenced in your project

## Usage Example

```csharp
@inject IJSRuntime JSRuntime

Export to Excel

@code {
private async Task ExportToExcel()
{
await grid.ExportMudDataGrid(JSRuntime, "exported_data.xlsx");
}
}
```

## Contributing

1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Open a Pull Request

## License

Distributed under the MIT License.