• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 746
  • Last Modified:

using report viewer control on .net website

I am trying to use report viewer control on a page on my .net website creating on VS2010, but I get the following error on my page in the report viewer area:

    The item '/DataMgmtReports/MyReportLetter.rdl' cannot be found. (rsItemNotFound)

When I browse to the report server url (http://MyServer/ReportServer_DEV) I can see that DataMgmtReports folder is listed there. When I click on it, I can see MyReportLetter listed in the folder. When I click on the report name I can see the reoprt content in the browser. Why do I get rsItemNotFound?

My Default.aspx page looks like this:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <h2>
       POC for Report Viewer
    </h2>
    
    <p>
        &nbsp;<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width = "90%" BorderStyle = "Ridge" BorderColor = "Black" Visible = "true">        </rsweb:ReportViewer>
    </p>
</asp:Content>

Open in new window


The code behind Default.aspx.cs has the following 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;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string FolderName = "DataMgmtReports";
        string FileName = "MyReportLetter.rdl";
        try
        {
            ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://MyServer/ReportServer_DEV");
            ReportViewer1.ServerReport.ReportPath = "/" + FolderName + "/" + FileName;
            ReportViewer1.ShowPrintButton = true;
        }
        catch { }
    }

}

Open in new window



Thanks for your help.
0
patd1
Asked:
patd1
  • 3
  • 3
1 Solution
 
sammySeltzerCommented:
Clearly a permission issue.
0
 
patd1Author Commented:
how do I solve it?

Thanks.
0
 
sammySeltzerCommented:
Describe what you *did* to invoke that error.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
patd1Author Commented:
I created a ReportViewer control on my page and then trying to load a report in this control.

<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width = "90%" BorderStyle = "Ridge" BorderColor = "Black" Visible = "true">        </rsweb:ReportViewer>

Open in new window


ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://MyServer/ReportServer_DEV");
            ReportViewer1.ServerReport.ReportPath = "/" + FolderName + "/" + FileName;
            ReportViewer1.ShowPrintButton = true;

Open in new window

0
 
sammySeltzerCommented:
Just looking at these 2 lines:

            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://MyServer/ReportServer_DEV");
            ReportViewer1.ServerReport.ReportPath = "/" + FolderName + "/" + FileName;

Open in new window


It looks like you are trying to accomplis this:

http://http://MyServer/ReportServer_DEV/folderName/FileName

Is that correct?

If so, what happens if you try:

            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://MyServer/ReportServer_DEV/");
            ReportViewer1.ServerReport.ReportPath = FolderName + "/" + FileName;

Open in new window


or even just simply

            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://MyServer/ReportServer_DEV");
            ReportViewer1.ServerReport.ReportPath = FolderName + "/" + FileName;

Open in new window

0
 
patd1Author Commented:
good
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now