Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
i try to show sql reports in asp.net web page everything seems fine but when i click on button and want to show reports then this shows

HTML
The item '/Report Project1/Report1.rdl' cannot be found. (rsItemNotFound)


but i add report project1 and also add report1
here is code

C#
protected void Button1_Click(object sender, EventArgs e)
       {

           ReportViewer2.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
           ReportViewer2.ServerReport.ReportServerUrl = new Uri("http://lenovo-pc/ReportServer");
           ReportViewer2.ServerReport.ReportPath = "/Report Project1/Report1.rdl";
           ReportViewer2.ServerReport.Refresh();
       }

is the path right or wrong?
Posted
Updated 2-Feb-14 1:46am
v2
Comments
VICK 4-Feb-14 23:55pm    
is your report viewer visible on the aspx page???

or Have you tried ReportViewer2.Visible = true;
???

kindly paste your Design page(aspx) to see the html content of your report viewer and surroundings.Might be there can be issue of reportviewer nested in some invisible div or td etc.

Kindaly checking this way i have a method for displaying the report with parameters.that is work perfect in my project.

private void ShowReport()
    {

        ReportViewer1.LocalReport.SetParameters(new ReportParameter("ReportParameter1", "Created BY :" + user.FIRSTNAME + user.LASTNAME));


        this.ReportViewer1.LocalReport.ReportEmbeddedResource = "Reports.Report.rdlc";
        ReportParameter rp = new ReportParameter("ReportParameter1", "Created By: " + user.FIRSTNAME +" "+ user.LASTNAME);
        ReportParameter rp1 = new ReportParameter("ReportParameter2", "Start Date: " + this.txtDateFrom.Text);
        ReportParameter rp2 = new ReportParameter("ReportParameter3", "End Date: " + this.txtDateTo.Text);
        ReportParameter rp4 = new ReportParameter("ReportParameter4", "DWCExchange Inc.");
        ReportParameter rp5 = new ReportParameter("ReportParameter5", "Total Count: ");

        this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1, rp2, rp4, rp5 });
        txtDateFrom1 = txtDateFrom.Text;
        txtDateTo1 = txtDateTo.Text;
        Office1 = drpOffice.SelectedValue;
        ReportViewer1.LocalReport.DataSources.Clear();
        DataSet dsGetHearing = null;

        SqlConnection sqlCon = new SqlConnection();
        // sqlCon.ConnectionString =ConfigurationManager.ConnectionStrings["EDEXConnectionString"].ConnectionString;
        sqlCon.ConnectionString = Utils.getSystemParameter("dsn");

         dsGetHearing = new DataSet();

        SqlCommand cmd = new SqlCommand("SPGetPatientHearing", sqlCon);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@Office", Office1);
        cmd.Parameters.AddWithValue("@FuturePrior", "");
        cmd.Parameters.AddWithValue("@Days", "");
        cmd.Parameters.AddWithValue("@FromDate", txtDateFrom1);
        cmd.Parameters.AddWithValue("@ToDate", txtDateTo1);
        cmd.Parameters.AddWithValue("@OutQuery", "");
        cmd.Parameters.AddWithValue("@IsExecute", 1);

        SqlDataAdapter data = new SqlDataAdapter(cmd);
        data.Fill(dsGetHearing);

        ReportDataSource reportDSPartiesList =
new ReportDataSource("DataSet1",
                     dsGetHearing.Tables[0]);
        ReportViewer1.LocalReport.DataSources.Add(reportDSPartiesList);

        ReportViewer1.LocalReport.Refresh();
    }
 
Share this answer
 
v2
Comments
Diya Ayesa 2-Feb-14 9:39am    
this is very complicated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900