Code Monkey home page Code Monkey logo

reportviewerformvc's Introduction

ReportViewer for MVC

ReportViewer for MVC is a simple library that makes it possible to use an ASP.NET ReportViewer control in an ASP.NET MVC application.

It provides a set of HTML Helpers and all of it's dependencies for displaying a report. Local or server, it handles all.

Why do I need this?

Server controls (like ReportViewer) cannot be used within Razor views. In order to use a control, you would need to add an ASPX view page and all of it's configurations, as well as, work through the code.

This library will setup all of that work for you, and will provide easy access to display your report. Also, it will auto-resize the report on your webpage to get the desired display.

Where can I get it?

This is a version modified to .Netframework 4.6.1 Download & install from NuGet.

Install-Package Chaso.ReportViewerForMvc -Version 1.1.1.1

The Original Source Is!

Download & install from NuGet.

PM> Install-Package ReportViewerForMvc

How do I use it?

After installing, the simplest solution is to setup the report on the controller and render it on the view.

The example below, will configure a report on localhost and auto-resize it. Check more details on the Getting Started page.

Controller:

var reportViewer = new ReportViewer()
{
    ProcessingMode = ProcessingMode.Remote,
    SizeToReportContent = true,
    Width = Unit.Percentage(100),
    Height = Unit.Percentage(100),
};            

reportViewer.ServerReport.ReportPath = "/ReportFolder/SampleReport";
reportViewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer/");

ViewBag.ReportViewer = reportViewer;

View:

@Html.ReportViewer(
    ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, 
    new { scrolling = "no" })

More info

Check the Wiki for the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.