logo

Exporting reports with .Net Razor layout

To be able to export a .NET Razor report to excel and other types of files, you need to create an exportable form. An exportable form is created using a simple and convenient tool - FastReport. This tool does not provide the same capabilities as the .NET Razor markup language, but it allows creating an exportable form very quickly. At the same time, in the Web Application, you still can view the .NET Razor report form, because different layouts are used for viewing and exporting.

To add a FastReport form for exporting:

1. Open the Display Settings tab and select FastReport in the Document Print/Export Layout unit. A new FastReport layout tab will be added. The content of this tab is used for exporting and printing the report.

2. Using the data from the report data source, you can create a simple report form, intended for export.

Now, when viewing such a report in the Web Application, you will see the form, created using .NET Razor. While the report toolbar will contain the Export button, which allows exporting the report to an MSWord, MSExcel, PDF, RTF or TXT file.