Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a problem on uploading microsoftreportviewer.
C#
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {


            roomno = Request.QueryString["RoomNo"];
            id = Request.QueryString["id"];
            this.ReportViewer1.LocalReport.DataSources.Clear();
            DataSet1 ds = new DataSet1(); // .xsd file name
            DataTable dt = new DataTable();
            con.ConnectionString = conctn;
            // Just set the name of data table
            dt.TableName = "Print Advance Report";
            dt = getAllOrders(); //This function is located below this function
            ds.Tables[0].Merge(dt);
            Microsoft.Reporting.WebForms.ReportDataSource rptDataSource = new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1_DataTable1", dt);
            this.ReportViewer1.LocalReport.DataSources.Add(rptDataSource);
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("Checkout.rdlc");
            this.ReportViewer1.LocalReport.Refresh();
        }
    }


public DataTable getAllOrders()
    {
        con.ConnectionString = conctn;
        //SqlCommand cmd = new SqlCommand();
        DataSet ds = null;
        SqlDataAdapter adapter;
        try
        {
            ds = new DataSet();
            adapter = new SqlDataAdapter("select C.BillNo,dbo.GuestName(C.GuestID) as Name,convert(varchar(10),C.Date,103) as Date,convert(varchar(10),R.ArrivalDate,103) as ArrivalDate,R.ArrivalTime,convert(varchar(10),C.DepartureDate,103) as DepartureDate,C.DepartureTime,R.RoomRent,C.TotalRoomRent,C.RoomNo,E.NoOfPersons,C.LaundaryBill,C.FoodingBill,A.LuxuryTax,A.ServiceTax,A.ServiceCharges,A.AdvanceAmount,C.TotalDays,C.Refund,C.Total,C.GrandTotal,C.Discount,C.ExtraBedCharges,C.ExtraAmount from CheckOut C inner join Amount A on C.GuestID=A.GuestID inner join AllotRoom R on C.GuestID=R.GuestID inner join GuestEntry E on E.ID=C.GuestID where C.RoomNo='" + roomno + "' and C.GuestID='" + id + "'", con);
            adapter.Fill(ds);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {
            //cmd.Dispose();
            //if (Con.State != ConnectionState.Closed)
                con.Close();
        }
        return ds.Tables[0];
    }

I am getting the following Error:

Not Found
The requested document was not found on this server.
Posted
v3
Comments
[no name] 30-Jul-12 11:16am    
The error message "The requested document was not found on this server" is fairly obvious don't you think? Do you have an actual question?
Member 8233601 31-Jul-12 0:41am    
tell me solution boss

1 solution

You are trying to access the report like this:
C#
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("Checkout.rdlc");

Error suggests that this path defined is incorrect and it was an incorrect report path.

You need to make sure that the correct relative or absolute path of the report is set.
 
Share this answer
 
Comments
Member 8233601 31-Jul-12 0:25am    
please provide me proper instruction with any practical demo..
Sandeep Mewara 31-Jul-12 2:45am    
It cannot be more clear. Your report path is incorrect.

For example:
// Absolute path usage
this.ReportViewer1.LocalReport.ReportPath = @"C:/MyReportsResideHere/Checkout.rdlc";

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