2016-07-14 4 views
0

xtraReport-EFdatasource를 목록에 바인딩하려고하는데 디자이너 모드에서 마법사를 사용하여이 작업을 빠르게 수행했지만 런타임시 데이터 원본을 바인딩 할 수 없습니다. 바인딩 devexpress xtrareport EFdatasource 런타임에

DataSource = Services.CoursesList(); 

는 또한 행운과 XtraReport1_DataSourceDemanded 이벤트 보고서 생성자에서이 코드를 tryed. devexpress 웹 사이트는 bindingsource를 사용하여 예제를 보여 주지만, EFdatasource를 사용하여 예제를 보여줍니다. 코드 샘플을 보내 주시겠습니까?

답변

0

나는 당신이 참조 제안 - How to use Entity Framework with Xtrareports

당신의 작업을 수행하는 가장 좋은 방법은 별도의 클래스 라이브러리로 보고서 클래스와 엔티티 객체를 배치하는 것입니다. 이 경우 을 bind the Report to a custom object at design time and provide data at run time 수 있습니다.

는 을 XtraReport.DataSourceDemanded event, 만들고, 엔티티 객체를 처리하고 XtraReport.DataSource 속성을 통과하여 보고서 인스턴스에 데이터를 전달합니다.

더 참고 :
How to use the XtraReport with the Entity Framework

관련 문제