I have gone through http://www.telerik.com/help/reporting/entitydatasource.html but am completely stummped. My code generates no errors but all of the reports are coming up blank.
Here is my code:
XAML Element:
LoadTelericReport() is called after the data source and page has been initialized.
The second part is the class that pulls from the Entity Framework:
Both sections are run fully, and AllEvents.ToList() is returning a full List<EventType> (if this matters it isn't called until after it has been bound to telericPersonReport.
As far as I can tell the WPF reporting front end just isn't displaying the List<EventType>, but it also isn't throwing an errors which seems strange. Is there something clearly wrong with my code, am I just completely off on how this works?
Thank you all for any directions you can point me in!
Here is my code:
XAML Element:
<
telerik:ReportViewer
Name
=
"telerikPersonReport"
Height
=
"275"
/>
LoadTelericReport() is called after the data source and page has been initialized.
public
void
LoadTelericReport()
{
Telerik.Reporting.EntityDataSource entityDataSource =
new
Telerik.Reporting.EntityDataSource();
ReportEntity objectContext =
new
ReportEntity();
entityDataSource.ObjectContext = objectContext;
entityDataSource.ObjectContextMember =
"Events"
;
Telerik.Reporting.Report report =
new
Telerik.Reporting.Report();
report.DataSource = entityDataSource;
Telerik.Reporting.InstanceReportSource reportSource =
new
Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;
telerikPersonReport.ReportSource = reportSource;
telerikPersonReport.RefreshReport();
}
The second part is the class that pulls from the Entity Framework:
public
class
ReportEntity
{
Attendance_Tracker ThisData =
new
Attendance_Tracker();
public
ReportEntity()
{
ThisData.Attendances.Load();
ThisData.Attendees.Load();
ThisData.Events.Load();
ThisData.Sessions.Load();
}
public
List<EventType> Events()
{
var AllEvents = from e
in
ThisData.Events.Local
select
new
EventType()
{
EventID = e.EventID,
EventName = e.EventName,
StartDate = e.StartDate,
EndDate = e.EndDate,
count = (from a
in
ThisData.Attendances.Local
where a.Session.Event == e
select a).Count()
};
return
AllEvents.ToList();
}
}
Both sections are run fully, and AllEvents.ToList() is returning a full List<EventType> (if this matters it isn't called until after it has been bound to telericPersonReport.
As far as I can tell the WPF reporting front end just isn't displaying the List<EventType>, but it also isn't throwing an errors which seems strange. Is there something clearly wrong with my code, am I just completely off on how this works?
Thank you all for any directions you can point me in!