public byte[] GetCandidateAssessmentDownloadFileForCentre(int candidateAssessmentId, int candidateId) { var summaryData = selfAssessmentDataService.GetCandidateAssessmentExportSummary(candidateAssessmentId, candidateId); var detailData = selfAssessmentDataService.GetCandidateAssessmentExportDetails(candidateAssessmentId, candidateId); var details = detailData.Select( x => new { x.Group, x.Competency, x.CompetencyOptional, x.AssessmentQuestion, x.SelfAssessmentRequired, x.SelfAssessmentResult, x.SelfAssessmentComments, x.Reviewer, x.ReviewerPrn, x.Reviewed, x.ReviewerComments, x.ReviewerVerified, x.RoleRequirements } ); using var workbook = new XLWorkbook(); AddSummarySheet(workbook, summaryData); AddSheetToWorkbook(workbook, "Details", details); using var stream = new MemoryStream(); workbook.SaveAs(stream); return(stream.ToArray()); }
public CandidateAssessmentExportSummary GetCandidateAssessmentExportSummary( int candidateAssessmentId, int candidateId ) { return(selfAssessmentDataService.GetCandidateAssessmentExportSummary(candidateAssessmentId, candidateId)); }