Crystal Reports & EF CodeFirst relations
Note: I'm new to Crystal reports, as I'd always used ActiveReports at previous jobs, however my current customer is insisting on Crystal.
I am wanting to do a basic report listing data from multiple EF CodeFirst entities. I can make an IEnumerable of my data that I need by doing the following:
var data = from r in _db.Registrations
select new AdminReportViewModel
{
Presentation1 = r.Presentation1.Name,
Presentation2 = r.Presentation2.Name,
Presentation3 = r.Presentation3.Name,
Presentation4 = r.Presentation4.Name,
StudentName = r.Student.FullName,
StudentSession = r.Student.Session.ToString(),
TeacherName = r.Student.Teacher.FullName
};
Howe开发者_JAVA技巧ver, I can not seem to bind this AdminReportViewModel object to a report like I can with a Registration object. It asks me for an xml schema file. However, if I bind a Registration object, I can only get the StudentId, not the related Student entity.
Is there a better way to do this, to bind the report to all my Registration objects, and load the object's related entities into labels?
精彩评论