Razor Page Samples - Excel Reporting

With the wide adoption of Microsoft Excel and the Office Open XML standard, there is no substitute for taking advantage of the leading spreadsheet component in your .NET Web Apps. You can use SpreadsheetGear to deliver Microsoft Excel 97-2019 and Excel for Office 365 reports in a variety of ways.

Simple Excel Report

This sample shows how to create a new workbook, add some values, and stream it to a Microsoft Excel file format (*.xlsx / *.xlsm / *.xls).

Excel Report with Formulas and Formatting

This sample shows how to create a new workbook, add values, formulas, defined names and formatting, and stream it to Microsoft Excel.

Excel Report with Formatted Chart

This sample shows how to create a new workbook, add some values, add a chart, format the chart, and stream it to Microsoft Excel.

Excel Report with Chart (From Template Workbook)

This sample shows how to load a workbook containing a chart, add some values, and stream it to Microsoft Excel.

Excel Report with Chart Linked to Defined Name

This sample shows how to load a workbook containing a chart series linked to a defined name, change the defined name range reference, and stream it to Microsoft Excel. For charts with multiple series, use Excel to set each chart series to refer to a unique defined name.

Worksheet with Chart to Multiple Worksheets with Charts

This sample shows how to load a workbook containing a chart, and use the worksheet copy routines to create multiple worksheets from one worksheet, and stream it to Microsoft Excel.

Excel Report with Picture

This sample shows how to create a new workbook, add a picture, and stream it to Microsoft Excel.

DataTable to Excel Workbook

This sample shows how to create a new workbook, copy data from a DataTable, and stream it to Microsoft Excel.

DataTable to Excel Workbook with Chart

This sample shows how to load a workbook containing a chart, insert data from a DataTable which automatically expands the chart link range, and stream it to Microsoft Excel.

DataTable to Excel Workbook with Formats and Formulas

This sample shows how to insert data from a DataTable into an Excel workbook, merging the data with formatting and formulas. The results are displayed in custom Tag Helper.

DataSet to Excel Workbook with Formats and Formulas

This sample shows how to create a new workbook, insert data from multiple DataTables, merge this data with formatting and formulas from a template workbook, and stream it to Microsoft Excel.

SQL DataTable to Workbook

This sample queries data into a DataTable from SQLite and copies it into an Excel workbook using IRange.CopyFromDataTable(...)..

SQL DataTable to Template Workbook

This sample queries data into a DataTable from SQLite and copies it into a preformatted range from an existing Excel workbook template using IRange.CopyFromDataTable(...).

Excel Workbook Consolidation

This sample shows how to utilize the IRange.Copy method to dynamically copy and consolidate data from multiple workbooks. It also demonstrates using a Tag Halper to render the contents of a range, or downloading the resulting workbook.

Group, Outline and Summarize to Excel

This sample shows how to utilize various outline APIs to create a report with the ability to expand and collapse detail levels of data.