diff --git a/src/Domain.LinnApps/Reports/BuildsDetailReportService.cs b/src/Domain.LinnApps/Reports/BuildsDetailReportService.cs index e1d9d43b..fc38d2b7 100644 --- a/src/Domain.LinnApps/Reports/BuildsDetailReportService.cs +++ b/src/Domain.LinnApps/Reports/BuildsDetailReportService.cs @@ -32,9 +32,8 @@ public ResultsModel GetBuildsDetailReport( { var table = this.databaseService.GetBuildsDetail(from, to, quantityOrValue, department, monthly, partNumbers); var partGroups = table.Select().GroupBy(r => r[2]).ToList(); - var weeks = partGroups - .Select( - g => ((DateTime)g.First().ItemArray[4])).Distinct().OrderBy(w => w).ToList(); + var weeks = partGroups.SelectMany(x => x.Select(y => (DateTime)y.ItemArray[4])) + .Distinct().OrderBy(date => date).ToList(); var colHeaders = new List { "Part Number" }; colHeaders.AddRange(weeks.Select(w => w.ToString("dd-MMM-yyyy")));