I am binding RDLC Report viewer in my project but getting this error
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Server could not create ASP.reporting_reportvalueprediction_aspx.
Stack Trace:
[InvalidOperationException: Server could not create ASP.reporting_reportvalueprediction_aspx.] __ASP.FastObjectFactory_app_web_1r4mqrnz.Create_ASP_reporting_reportvalueprediction_aspx() +192 System.Web.Compilation.BuildResultCompiledType.CreateInstance() +31 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +104 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +39 System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +386 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163
This is my code which I have tried
<%@ Page Language="vb" Debug="true" AutoEventWireup="false" CodeBehind="ReportValuePrediction.aspx.vb" Inherits="TimiWeb.ReportValuePrediction" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!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="ScriptManager" runat="server">
</asp:ScriptManager>
<div>
<rsweb:ReportViewer ID="rptReportViewer" runat="server" Width="100%" Height="700px">
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
Imports Microsoft.Reporting.WebForms
Public Class ReportValuePrediction
Inherits System.Web.UI.Page
Private _dt As DataTable
Public Sub New(ByVal dt As DataTable)
_dt = dt
End Sub
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
Dim rep As LocalReport = rptReportViewer.LocalReport
rep.ReportPath = "/Reporting/ValuePrediction.rdlc"
Dim rds As New ReportDataSource()
If _dt.Rows.Count > 0 Then
rds.Name = "ValuePredictionDS"
rds.Value = _dt
rep.DataSources.Add(rds)
End If
End If
End Sub
End Class