FastReport .NET 2013.2 MVC

2013-03-11

We have released FastReport .NET 2013.2 with MVC support. And I'd like to inform all WebReport developers about some changes.

First. An extension of the handler in web.config was changed. You need replace old string «FastReport.Export.aspx» to new string «FastReport.Export.axd» everywere. Web application without these changes will throw an exception and you will see text with error and instructions for changes in web.report.

You can check the handler of WebReport by typing in the address bar: http://site_address/app_folder/ FastReport.Export.axd (replace site_address and app_folder with your values).

In the successfull request case you'll see FastReport version number and server time.

Second. We have added support of ASP.NET MVC framework. You will not have any troubles with using our control in ASPX (MVC 2) – You'll just enough drag control from Toolbox to the page. WebReport will set all needed changes in web.config automatically. Let see the demo of WebReport in aspx in folder \Demos\C#\MvcDemo.

Also I should say how to use the WebReport in Razor (MVC 3,4).  You will need add lines with handler defenitions in web.config in root folder of your web-application.  Add line in section <system.webServer> <handlers> for using in IIS7:
<add name="FastReportHandler" path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport" />

Add line in section <system.web> <httpHandlers> for using in IIS6:
<add path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport" />

Then you should modify web.config in folder with Views.  Add lines in section <system.web.webPages.razor> <namespaces>:
<add namespace="FastReport" />
<add namespace="FastReport.Web" />

Add lines in file _Layout.cshtml in tag <head>:
@WebReportGlobals.Scripts()
@WebReportGlobals.Styles()

Now you can draw the report on the View. Go to the controller and create a WebReport:
WebReport webReport = new WebReport(); // create object
webReport.Width = 600;  // set width
webReport.Height = 800; // set height
webReport.Report.RegisterData(dataSet, "AppData"); // data binding
webReport.ReportFile = this.Server.MapPath("~/App_Data/report.frx");  // load the report from the file
ViewBag.WebReport = webReport; // send object to the View

Go to View and add the line:
@ViewBag.WebReport.GetHtml()

Similar code to create WebReport you can also write directly in View.

Let see the demo of WebReport in Razor in folder \Demos\C#\MvcRazor. There are various samples for load the report, including preprepared, and there is an example of using event StartReport.

Do not forget to add the missing dll in bin directory.

.NET .NET FastReport FastReport MVC MVC
March 25, 2025

How to Merge Multiple Reports into One in FastReport .NET

FastReport .NET is a powerful tool for creating and managing reports. In this article, we will look at how to combine multiple reports into one in FastReport .NET.
March 11, 2025

How to Use FastReport .NET Avalonia on Fedora Workstation with Wayland Protocol

In this article, we will discuss how to run FastReport .NET Avalonia on the "Fedora Workstation 39" operating system with Wayland protocol.
March 07, 2025

How to Create a QR Code with an Image in FastReport .NET

The article figured out how to insert a picture into a QR Code from the report designer FastReport.NET in just a couple of clicks.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.