logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Forgot password?
    • en
    • ru
    • pt
    • es
    • 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
  • Localization of Online Designer and WebReport

    August 15, 2017

    Report Localization is very urgent task in a Web environment. Because your site can be

    read more
  • How to use Plugin Manager

    September 3, 2019

    FastReport.Net provides a plugin mechanism for extending the functionality of the report designer. Most of

    read more
  • How to connect to Firebird from FastReport.Net

    November 15, 2019

    In order to connect to Firebird database in FastReport.Net Designer a plug-in connector is provided. It

    read more
  • How to hide columns in a list if there is no data

    April 7, 2020

    When making the report, we want it to be "friendly" to the consumers as much

    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
Chief Development Officer
.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
  • Our team
  • Contact us

© 1998-2021 by Fast Reports Inc.

  • Privacy Policy