在Windows Server上上传reportviewer [英] upload reportviewer on windows server

查看:55
本文介绍了在Windows Server上上传reportviewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在上传microsoftreportviewer时遇到问题.

Hi I have a problem on uploading microsoftreportviewer.

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.

推荐答案

您正试图像这样访问报告:
You are trying to access the report like this:
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.


这篇关于在Windows Server上上传reportviewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆