使用Microsoftreportviewer上传Web应用程序 [英] upload web application with Microsoftreportviewer
本文介绍了使用Microsoftreportviewer上传Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我正在研究Web应用程序.我将Visual Studio 2008用作ide,将sql server 2005用作数据库.我使用Microsoftreportviewer来打印报告.它在localhost上工作正常,但是在服务器上升级时,显示以下错误:在服务器上找不到文档.所以请任何人帮助我缩短此prblm.
我在(.cs)文件上使用了以下代码
Hi, i am working on web application. I am using visual studio 2008 as ide and sql server 2005 as database. i used Microsoftreportviewer to print the report. it work fine at localhost but when it''s uploded on server it shows the following error: Document is not found on the server. so plz anyone help me to short out this prblm.
i used the following code on (.cs) file
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class PrintCheckout : System.Web.UI.Page
{
SqlConnection con = new SqlConnection();
string conctn = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
SqlCommand com;
string roomno = "";
string id = "";
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];
}
}
推荐答案
这是一个巨大的代码转储.哪一行有错误?文件丢失,您是否确定哪一行出现错误,并验证您引用的所有文件实际上都在您期望的位置?
This is a huge code dump. What line has the error ? A file is missing, did you work out what line had the error, and verified that all the files you reference are actually where you expect ?
这篇关于使用Microsoftreportviewer上传Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文