This is what i have done :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestingPage.aspx.cs" Inherits="TestingPage" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<rsweb:ReportViewer ID="MyReportViewer" runat="server" Font-Names="Verdana" Font-Size="8pt"
InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
Width="1086px">
<ServerReport ReportServerUrl="" />
</rsweb:ReportViewer>
<br />
</form>
</body>
</html>
try
{
MyReportViewer.ProcessingMode = ProcessingMode.Remote;
MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");
MyReportViewer.ServerReport.ReportPath = "/Pages/ReportViewer.aspx?%2fCallingImages&rs:Command=Render";
MyReportViewer.ServerReport.Refresh();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
Above is my coding to get the report in webform in page_load. But running above code is giving me this error :
- The path of the item '/Pages/ReportViewer.aspx?%2fCallingImages&rs:Command=Render' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath)
Note :
The right path of running this report in browser is :
http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fCallingImages&rs:Command=Render
Please tell me why can't i run this report ?