LT.ReportViewerForMvc 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LT.ReportViewerForMvc --version 1.0.0
                    
NuGet\Install-Package LT.ReportViewerForMvc -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LT.ReportViewerForMvc" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LT.ReportViewerForMvc" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LT.ReportViewerForMvc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LT.ReportViewerForMvc --version 1.0.0
                    
#r "nuget: LT.ReportViewerForMvc, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LT.ReportViewerForMvc@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LT.ReportViewerForMvc&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LT.ReportViewerForMvc&version=1.0.0
                    
Install as a Cake Tool

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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 3,614 10/22/2024
1.0.0 3,400 10/22/2024