[英]Report displays blank page on client machine
我的WPF項目使用Crystal Reports。 一切都在發展中。 報表將加載並顯示,並且數據集沒有問題。 以下代碼調用該報告:
ReportDocument report = new ReportDocument();
report.Load("../../CrystalReport.rpt");
CustomerLedgerDataSet ds = new CustomerLedgerDataSet();
DataTable dt1 = ds.BillProduct;
DataTable dt2 = ds.Customer;
foreach (var item in customer.CustomerCollection)
{
dt2.Rows.Add(item.Customerid, item.CustomerName, item.CustomerLocation,
item.Customerbalance, item.CustomerLastTally, item.Customerphone);
}
report.SetDataSource(ds);
crystalReportsViewer2.ViewerCore.ReportSource = report;
這在開發中有效,但在客戶端PC上部署時無效。 顯示報告查看器,但報告為空。 罪魁禍首是這一行,因為它無法解決問題:
report.Load("../../CrystalReport.rpt");
我單擊一次以發布進行部署,並在客戶端PC上安裝了相同版本的Crystal Runtime。
避免使用大量文件夾:嘗試將報告復制到項目文件夾本身中。 將此路徑從您的報告文件夾中移出
report.Load("~/CrystalReport.rpt")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.