ybt
asked on
SSRS report preview problem in asp.net
ASP.NET C#
I'm trying to view ssrs report in reportviewer in webpage
got an error
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.We bForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
pointing to this row:
my aspx code:
my cs code
webconfig:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ValidationSettings:Un obtrusiveV alidationM ode" value="None" />
</appSettings>
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewe rWebContro l.axd" verb="*" type="Microsoft.Reporting. WebForms.H ttpHandler , Microsoft.ReportViewer.Web Forms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A"
validate="false" />
</httpHandlers>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.Report Viewer.Web Forms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A" />
<add assembly="Microsoft.Report Viewer.Com mon, Version=12.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A" />
<add assembly="Microsoft.Build. Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A" />
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting. RdlBuildPr ovider, Microsoft.ReportViewer.Web Forms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A" />
</buildProviders>
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="DbConnString" connectionString="Data Source=LSMSQL\LOVELLSQL;In itial Catalog="";User ID="";Password=""" providerName="System.Data. SqlClient" />
<add name="ExpanseConnectionStr ing" connectionString="Data Source=.\SQLEXPRESS;Attach DbFilename =|DataDire ctory|\Exp anse.mdf;I ntegrated Security=True;User Instance=True" providerName="System.Data. SqlClient" />
</connectionStrings>
<system.webServer>
<validation validateIntegratedModeConf iguration= "false" />
<handlers>
<add name="ReportViewerWebContr olHandler" preCondition="integratedMo de" verb="*" path="Reserved.ReportViewe rWebContro l.axd" type="Microsoft.Reporting. WebForms.H ttpHandler , Microsoft.ReportViewer.Web Forms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D 50A3A" />
</handlers>
</system.webServer>
</configuration>
I'm trying to view ssrs report in reportviewer in webpage
got an error
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.We
pointing to this row:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
my aspx code:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WEB_ONE1.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="484px" Width="737px">
</rsweb:ReportViewer>
<div>
</div>
</form>
</body>
</html>
my cs code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using Microsoft.ReportingServices.WebServer;
using System.Web.Configuration;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Resources;
using System.Globalization;
using System.Text;
using Microsoft.ReportingServices.WebServer;
namespace WEB_ONE1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// Set the processing mode for the ReportViewer to Remote
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = ReportViewer1.ServerReport;
// Set the report server URL and report path
serverReport.ReportServerUrl = new Uri("http://lsmsql/ReportServer_LOVELLSQL");
serverReport.ReportPath = "/Reports/Claim_Init_RPT";
serverReport.GetParameters();
ReportParameter key_no = new ReportParameter();
key_no.Name = "key_no";
key_no.Values.Add("121");
ReportParameter title = new ReportParameter();
title.Name = "title";
title.Values.Add("title");
ReportParameter userid = new ReportParameter();
userid.Name = "userid";
userid.Values.Add("user");
ReportParameter pwd = new ReportParameter();
pwd.Name = "pwd";
pwd.Values.Add("*******");
// Set the report parameters for the report
ReportViewer1.ServerReport.SetParameters(
new ReportParameter[] { key_no, title, userid, pwd });
ReportViewer1.DataBind();
}
}
}
}
webconfig:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ValidationSettings:Un
</appSettings>
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewe
validate="false" />
</httpHandlers>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.Report
<add assembly="Microsoft.Report
<add assembly="Microsoft.Build.
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.
</buildProviders>
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="DbConnString" connectionString="Data Source=LSMSQL\LOVELLSQL;In
<add name="ExpanseConnectionStr
</connectionStrings>
<system.webServer>
<validation validateIntegratedModeConf
<handlers>
<add name="ReportViewerWebContr
</handlers>
</system.webServer>
</configuration>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try to install Microsoft.ReportViewer.201 2 instead of 11.
ASKER
Thank you, finally I made it working
Glad to help you!
ASKER