├── BlazorExcelSpreadsheet
├── Pages
│ ├── _ViewImports.cshtml
│ ├── Index.cshtml
│ ├── Counter.cshtml
│ └── FetchData.cshtml
├── wwwroot
│ ├── css
│ │ ├── open-iconic
│ │ │ ├── font
│ │ │ │ ├── fonts
│ │ │ │ │ ├── open-iconic.eot
│ │ │ │ │ ├── open-iconic.otf
│ │ │ │ │ ├── open-iconic.ttf
│ │ │ │ │ ├── open-iconic.woff
│ │ │ │ │ └── open-iconic.svg
│ │ │ │ └── css
│ │ │ │ │ └── open-iconic-bootstrap.min.css
│ │ │ ├── ICON-LICENSE
│ │ │ ├── README.md
│ │ │ └── FONT-LICENSE
│ │ └── site.css
│ ├── index.html
│ └── sample-data
│ │ └── weather.json
├── App.cshtml
├── Shared
│ ├── MainLayout.cshtml
│ ├── SurveyPrompt.cshtml
│ └── NavMenu.cshtml
├── _ViewImports.cshtml
├── Startup.cs
├── Program.cs
└── BlazorExcelSpreadsheet.csproj
├── README.md
├── BlazorUtils
├── content
│ └── saveAsFile.js
├── FileUtils.cs
└── BlazorUtils.csproj
├── LICENSE
├── BlazorExcelSpreadsheet.sln
└── .gitignore
/BlazorExcelSpreadsheet/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @layout MainLayout
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BlazorExcelSpreadsheet
2 | Generate an Excel spreadsheet from Blazor
3 |
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page "/"
2 |
3 |
Hello, world!
4 |
5 | Welcome to your new app.
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danroth27/BlazorExcelSpreadsheet/HEAD/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danroth27/BlazorExcelSpreadsheet/HEAD/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danroth27/BlazorExcelSpreadsheet/HEAD/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/danroth27/BlazorExcelSpreadsheet/HEAD/BlazorExcelSpreadsheet/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/App.cshtml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
--------------------------------------------------------------------------------
/BlazorUtils/content/saveAsFile.js:
--------------------------------------------------------------------------------
1 | function saveAsFile(filename, bytesBase64) {
2 | var link = document.createElement('a');
3 | link.download = filename;
4 | link.href = "data:application/octet-stream;base64," + bytesBase64;
5 | document.body.appendChild(link); // Needed for Firefox
6 | link.click();
7 | document.body.removeChild(link);
8 | }
9 |
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/Pages/Counter.cshtml:
--------------------------------------------------------------------------------
1 | @page "/counter"
2 |
3 | Counter
4 |
5 | Current count: @currentCount
6 |
7 |
8 |
9 | @functions {
10 | int currentCount = 0;
11 |
12 | void IncrementCount()
13 | {
14 | currentCount++;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/Shared/MainLayout.cshtml:
--------------------------------------------------------------------------------
1 | @inherits LayoutComponentBase
2 |
3 |
6 |
7 |
8 |
11 |
12 |
13 | @Body
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BlazorExcelSpreadsheet/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Components.Forms
3 | @using Microsoft.AspNetCore.Components.Layouts
4 | @using Microsoft.AspNetCore.Components.Routing
5 | @using Microsoft.JSInterop
6 | @using BlazorExcelSpreadsheet
7 | @using BlazorExcelSpreadsheet.Shared
8 | @using OfficeOpenXml
9 | @using OfficeOpenXml.Style
10 | @using System.Drawing
11 | @using BlazorUtils
--------------------------------------------------------------------------------
/BlazorUtils/FileUtils.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.JSInterop;
2 | using System;
3 | using System.Threading.Tasks;
4 |
5 | namespace BlazorUtils
6 | {
7 | public static class FileUtil
8 | {
9 | public static Task SaveAs(this IJSRuntime js, string filename, byte[] data)
10 | => js.InvokeAsync