Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ public int GetActivityDetailRowCount(
{
return connection.QuerySingleOrDefault<int>(
@"SELECT COUNT(1) FROM
tActivityLog AS al
tActivityLog AS al INNER JOIN DelegateAccounts AS da ON al.CandidateID = da.ID
WHERE(al.LogDate >= @startDate) AND(@endDate IS NULL OR
al.LogDate <= @endDate) AND(al.CentreID = @centreId) AND(@jobGroupId IS NULL OR
al.LogDate <= @endDate) AND(al.CentreID = @centreId) AND (da.CentreID = @centreId) AND (@jobGroupId IS NULL OR
al.JobGroupID = @jobGroupId) AND(@customisationId IS NULL OR
al.CustomisationID = @customisationId) AND(@courseCategoryId IS NULL OR
al.CourseCategoryID = @courseCategoryId) AND(al.Registered = 1 OR
Expand Down Expand Up @@ -160,7 +160,7 @@ Users AS u INNER JOIN
DelegateAccounts AS da ON u.ID = da.UserID ON al.CandidateID = da.ID INNER JOIN
Customisations AS c ON al.CustomisationID = c.CustomisationID
WHERE (al.LogDate >= @startDate) AND (@endDate IS NULL OR
al.LogDate <= @endDate) AND (al.CentreID = @centreId) AND (@jobGroupId IS NULL OR
al.LogDate <= @endDate) AND (al.CentreID = @centreId) AND (da.CentreID = @centreId) AND (@jobGroupId IS NULL OR
al.JobGroupID = @jobGroupId) AND (@customisationId IS NULL OR
al.CustomisationID = @customisationId) AND (@courseCategoryId IS NULL OR
al.CourseCategoryID = @courseCategoryId) AND (al.Registered = 1 OR
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions DigitalLearningSolutions.Web/Services/ActivityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ private void AddActivityDetailSheet(XLWorkbook workbook, int centreId, ActivityF
{
var itemsPerPage = Data.Extensions.ConfigurationExtensions.GetExportQueryRowLimit(configuration);
var resultCount = GetActivityDetailRowCount(centreId, filterData);
if (resultCount == 0)
{
return;
}
int totalRun = (int)(resultCount / itemsPerPage) + ((resultCount % itemsPerPage) > 0 ? 1 : 0);
int currentRun = 1;
List<ActivityLogDetail> activityLogDetails = new List<ActivityLogDetail>();
Expand Down