Assembly References (From Visual studio2010 installation folder) :
Microsoft.ReportViewer.Common
Microsoft.ReportViewer.WebForms
Step 1 - Create a view called Report and bind it to strongly type ReportViewModel.
@model ReportViewModel
@{
ViewBag.Title = "Reports";
}
Reports: @Model.Title
height="965" width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes">
Step 2 - Add a WebForm(ReportViewer.aspx) to your Web Project under a folder called Reports. It should have following html code in it.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="Sample.Web.Reports.ReportViewer" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
Code behind
public partial class ReportViewer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ReportName = Request.QueryString["Name"];
if (ReportName != null)
{
string ReportServerURL = Request.QueryString["ServerURL"];
if (ReportServerURL == null)
ReportServerURL = @"http://localhost/reportserver";
rptViewer.ShowParameterPrompts = true;
rptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
rptViewer.ServerReport.ReportServerUrl = new Uri(ReportServerURL);
rptViewer.ServerReport.ReportPath = string.Format("/{0}", ReportName);
}
}
}
this tutorial is not full
ReplyDeleteDeba deserves credit for providing this information in a simplified way. Helped me migrate a report application from asp to MVC. Appreciate it isn't enough info for a ReportViewer beginner.
ReplyDeleteThanks for sharing excellent informations. Your
ReplyDeletewebsite is very cool.
Premium
hi!,I really like your writing very so much!
ReplyDeleteMalwarebytes
Office 2017
Corel
Corel
An iOS course provides step-by-step learning for mobile application creation. It covers core concepts with practical exercises. This ios course supports career advancement. It is effective.
ReplyDeleteWell written! Our java training online
ReplyDeleteconnects core concepts with practical development.