2016-09-09 3 views
0

WPF 프로젝트에서 Crystal Reports를 사용합니다. 모든 것이 개발 단계에 있습니다. 보고서가로드되고 표시되며 DataSet에 문제가 없습니다. 다음 코드는 보고서를 호출합니다.보고서가 클라이언트 컴퓨터에서 빈 페이지를 표시합니다.

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");

enter image description here enter image description here

내가 배포 게시 한 번 클릭하고 클라이언트 PC에 크리스탈 런타임의 동일한 버전을 설치 :이 경로를 해결할 수 없기 때문에 범인이 라인 .

+0

참조 DLL을 복사합니까? 참조를 오른쪽 클릭하고 속성을 선택하십시오. 로컬 복사 필드에서 true를 선택하십시오. –

+0

그들은 이미 크리스탈 보고서를 위해 특히 사실입니다 –

답변

1

많은 폴더를 사용하지 마십시오. 프로젝트 폴더 자체에 보고서를 복사 해보십시오. 이 경로와 같은 보고서 폴더에서 이동하십시오.

report.Load("~/CrystalReport.rpt")