【发布时间】:2015-06-22 17:28:31
【问题描述】:
我正在尝试在ASP.net 和C# 中开发一个简单的水晶报表。我正在使用CrystalReportViewer 加载我的报告。
这是 C# 代码:
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con;
string connString = null;
connString = "Data Source=.;initial catalog=InvoiceSystem;user id=sa;password=rfm";
con = new SqlConnection(connString);
con.Open();
string query = null;
query = "Select * from tblInvoice";
SqlDataAdapter da = new SqlDataAdapter(query, con);
con.Close();
DataSetInv ds = new DataSetInv();
da.Fill(ds, "tblInvoice");
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath("~/CrystalReportInv.rpt"));
rpt.SetDataSource(ds);
CrystalReportViewer1.ReportSource = rpt;
}
问题是我的,CrystalReportViewer 不是render 我在浏览器上的报告,它是blank page。虽然没有错误,但可能有什么问题?
【问题讨论】:
-
你有没有把 aspnet_client 文件夹放到 IIS 根目录(C:\inetpub\wwwroot)
标签: asp.net c#-4.0 visual-studio-2012 crystal-reports webpage-rendering