Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 49 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
# Blazor DataGrid Export Memory Stream
A quick-start project that helps you how to export Grid Data as Memory Stream in Blazor Datagrid Component.

Documentation: https://blazor.syncfusion.com/documentation/datagrid/pdf-export#exporting-grid-data-as-stream

# Project prerequisites
Make sure that you have the latest versions of 'Visual Studio 2022' in your machine before starting to work on this project.
A production-ready sample demonstrating how to export [Blazor DataGrid](https://www.syncfusion.com/blazor-components/blazor-datagrid) data as memory streams for PDF generation and advanced data handling. This project showcases both basic memory stream export and advanced scenarios like merging multiple PDFs.

# How to run this application?
• To run this application, you need to first clone the <code>blazor-datagrid-export-memory-stream</code> repository and then open it in Visual Studio 2022.
## Overview

• Register the syncfusion license key in the Program.cs file, if you have any doubts check the documentation link: https://blazor.syncfusion.com/documentation/getting-started/license-key/how-to-register-in-an-application
This repository contains a complete Blazor application that demonstrates efficient data export patterns using the DataGrid component. Instead of writing directly to disk, the application exports grid data to in-memory streams, enabling flexible post-processing, dynamic content generation, and optimized performance for web-based scenarios.

## Features

- **Basic PDF Export**: Export grid data directly as a PDF memory stream
- **Advanced PDF Merging**: Combine multiple grid exports with custom styling into a single PDF
- **Custom Theme Support**: Apply custom colors, fonts, and borders to exported PDFs
- **Server-Side & Client-Side Rendering**: Leverages Blazor's interactive capabilities
- **Toolbar Integration**: Export functionality integrated into the DataGrid toolbar
- **Client-Side File Download**: Seamless download experience using JavaScript interop

## Prerequisites

- [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) or later
- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or later
- [Visual Studio Code](https://code.visualstudio.com/)

## Getting Started

### Clone the repository

```bash
git clone https://github.com/SyncfusionExamples/blazor-datagrid-export-memory-stream.git
cd blazor-datagrid-export-memory-stream/GridPDFStream
```

### Run with Visual Studio

1. Open the solution file using Visual Studio 2022 or later.
2. Restore the NuGet packages by rebuilding the solution.
3. Build the project to ensure there are no compilation errors.
4. Run the project.

### Run with .NET CLI

```bash
# Restore dependencies
dotnet restore

# Run the project
dotnet run
```

## References

- Export Documentation: https://blazor.syncfusion.com/documentation/datagrid/pdf-export#exporting-grid-data-as-stream
- Export Feature Demo: https://blazor.syncfusion.com/demos/datagrid/exporting?theme=fluent2

• Now, simply build and run your project to view the output.