logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Customer panel Support
    • en
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • FastReport .NET 2013.2 MVC
  • How to create a custom toolbar for web FastReport.NET report

    May 31, 2020

    Many users of report generators are interested in setting up the toolbar when reviewing the

    read more
  • How to use Online Designer in a knockout.js application

    June 30, 2019

    The knockout.js library was quite popular among web developers before the appearance of angular. Despite

    read more
  • How to create a report from web application code

    February 16, 2022

    Sometimes creating a report can turn into to be a real headache. For example, when

    read more
  • Interactive web report with drill down lists

    August 15, 2017

    In this article we look at how to create interactive reports with drop-down groups. We

    read more
  • How to create a report in an ASP .NET MVC application in Visual Basic

    March 3, 2022

    The Visual Basic .NET programming language is seen by many as an entry-level language.

    read more

FastReport .NET 2013.2 MVC

March 11, 2013

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.

about product download buy
avatar
Aleksandr Fediashov
Team lead
Fast Reports Team: Aleksandr Fediashov - Team Lead at Fast Reports
.NET FastReport MVC

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Contact us

© 1998-2022 by Fast Reports Inc.

  • Privacy Policy