2013-11-26 1 views
0

Visual Studio 2012에서 C# 클래스로 데이터 집합을 만들었습니다. 이제 VS보고를 사용하여 보고서를 만들고 싶습니다. 어떻게 그들을 묶을 수 있습니까? 보고서 디자이너에서 데이터 집합 정의를 사용하여 보고서를 만들려면 어떻게해야합니까?맞춤 설정 한 데이터 집합을 보고서에 연결

WinForm의 xsd 및 reportviewer를 기반으로 보고서를 만들었습니다.

private void Form9_Load(object sender, EventArgs e) 
    { 

     // listGeraete fetches all the data I need and does some calculations 
     listGeraete gList = new listGeraete(); 
     gList.addById(200001); 
     gList.addById(201000); 

     // This creates a DataSet with all the data I need. 
     // The dataset is well-formed and uses the same dataset definition 
     // that the report uses. 
     dsGeraete d = gList.getDataSet(); 


     // Something has to happen here to bind the dataSet to the reportViewer 



     this.reportViewer1.RefreshReport(); 


    } 

제가 인터넷 검색을 시도했지만 결과는 모두 데이터 집합에 SQL 서버 바인딩에 돌아와 - 즉 내가 원하는 게 아니에요 ...

어떤 도움

은 평가 될 것입니다 : 내가 가지고있는 것은 이것이다.

답변

1

테이블 어댑터를 채워야합니다. this video이 도움이되는지 확인하십시오.

1

데이터 집합을 데이터 소스로 설정 한 다음 새로 고침해야합니다. 구문 중 일부는 winforms 컨트롤에 대해 다를 수 있지만 이것은 asp.net 페이지에 대한 것입니다.

 this.reportViewer1.Reset(); 
     this.reportViewer1.ProcessingMode = ProcessingMode.Local; 
     this.reportViewer1.LocalReport.DataSources.Clear(); 
     this.reportViewer1.LocalReport.DataSources.Add(dataset); 
     this.reportViewer1.LocalReport.Refresh(); 
관련 문제