Hi,
We are experiencing poor performance when using XtraReports and Entity Framework (15.1.4). When we use the design wizard to populate the data the report takes 5 times longer than if we manually populate the data at runtime. Im not sure how much information you need but let me know if the below is not enough.
We have a SystemEvents table in our MySQL database which is quite large and once of the basic reports is just a listed of all the events grouped by the day on which they occurred so the report has a GroupHeader of the day of the event.
When using the designer to populate the data we use the following code :-
DevExpress.DataAccess.EntityFramework.EFConnectionParameters efConnectionParameters1 = new DevExpress.DataAccess.EntityFramework.EFConnectionParameters();
efConnectionParameters1.Source = typeof( ConnectReportDBContext );
efDataSource1 = new DevExpress.DataAccess.EntityFramework.EFDataSource(efConnectionParameters1);
string reportFilter; string reportCriteria;
ParameterCollection parameters = ReportParameters.BuildReportParameters(criteria, true, out reportFilter, out reportCriteria);
xrlReportCriteria.Text = reportCriteria == "" ? "All Gaming Calls" : reportCriteria;
foreach (Parameter p in parameters) { this.Parameters.Add§; }
this.FilterString = reportFilter;
this.DataSource = efDataSource1; this.DataMember = "SystemEvents";
The FilterString that is applying to the report is "[Started] >= ?dateTimeFrom And [Started] <= ?dateTimeTo And [SystemEventActive] = false"
Running this report for a month take 134 seconds.
When we populate the report using manual data, we use the following :-
var systemEvents = SystemEvent.GetAllSystemEventsForTimePeriodWithFilter( context, m_criteria, m_preference );
foreach ( var sysEvent in systemEvents ) {
double totalCallTime; double responseTime; double waitTime;
totalCallTime = ( sysEvent.Finished - sysEvent.Started ).TotalSeconds;
responseTime = sysEvent.Assigned == DateTime.MinValue ? 0 : ( sysEvent.Finished - sysEvent.Assigned ).TotalSeconds;
waitTime = sysEvent.Assigned == DateTime.MinValue ? totalCallTime : ( sysEvent.Assigned - sysEvent.Started ).TotalSeconds;
m_reportData.Add( new GamingLogReportData() { DayStarted = String.Format( "{0:dddd, MMMM yyyy}", sysEvent.Started ), Started = String.Format( "{0:hh:mm tt}", sysEvent.Started ), Event = sysEvent.CallType.Name, Machine = sysEvent.Item.ExternalID, Response = responseTime.ToString(), Wait = waitTime.ToString(), Total = totalCallTime.ToString(), User = sysEvent.User.FullName, Zone = sysEvent.Zone.LongName } );
}
//Bind The Report Data GroupField dateSorting = new GroupField( "DayStarted" ); dateSorting.SortOrder = XRColumnSortOrder.Ascending; GroupHeader1.GroupFields.Add( dateSorting );
this.DataSource = m_reportData;
xrlDateStarted.DataBindings.Add( "Text", DataSource, "DayStarted" ); xrlTime.DataBindings.Add( "Text", DataSource, "Started" ); xrlEvent.DataBindings.Add( "Text", DataSource, "Event" ); xrlMachine.DataBindings.Add( "Text", DataSource, "Machine" ); xrlZone.DataBindings.Add( "Text", DataSource, "Zone" ); xrlUser.DataBindings.Add( "Text", DataSource, "User" ); xrlResponse.DataBindings.Add( "Text", DataSource, "Response" ); xrlWait.DataBindings.Add( "Text", DataSource, "Wait" ); xrlTotalCallTime.DataBindings.Add( "Text", DataSource, "Total" );
Running the report this way for the same time period takes 17 seconds.
What would be the reason for the large difference in the time taken to generate the report?
Please let me know if I need to provide additional information.
Thanks,
Daniel.