File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
DigitalLearningSolutions.Web/Controllers/TrackingSystem/Centre/SelfAssessmentReports Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 88 using DigitalLearningSolutions . Web . Attributes ;
99 using DigitalLearningSolutions . Web . Models . Enums ;
1010 using DigitalLearningSolutions . Data . Enums ;
11- using System ;
1211 using DigitalLearningSolutions . Data . Utilities ;
1312 using DigitalLearningSolutions . Web . ViewModels . TrackingSystem . Centre . Reports ;
1413 using DigitalLearningSolutions . Web . Helpers . ExternalApis ;
15- using System . Threading . Tasks ;
1614 using Microsoft . Extensions . Configuration ;
1715 using DigitalLearningSolutions . Data . Extensions ;
1816 using DigitalLearningSolutions . Web . Services ;
@@ -75,8 +73,9 @@ public IActionResult DownloadDigitalCapabilityToExcel()
7573 public IActionResult DownloadSelfAssessmentReport ( int selfAssessmentId )
7674 {
7775 var centreId = User . GetCentreId ( ) ;
76+ var selfAssessmentName = selfAssessmentService . GetSelfAssessmentNameById ( selfAssessmentId ) ;
7877 var dataFile = selfAssessmentReportService . GetSelfAssessmentExcelExportForCentre ( ( int ) centreId , selfAssessmentId ) ;
79- var fileName = $ "Competency Self Assessment Report - Centre { centreId } - downloaded { DateTime . Today : yyyy-MM-dd} .xlsx";
78+ var fileName = $ "{ ( ( selfAssessmentName . Length > 50 ) ? selfAssessmentName . Substring ( 0 , 50 ) : selfAssessmentName ) } Report - Centre { centreId } - downloaded { clockUtility . UtcNow : yyyy-MM-dd} .xlsx";
8079 return File (
8180 dataFile ,
8281 FileHelper . GetContentTypeFromFileName ( fileName ) ,
You can’t perform that action at this time.
0 commit comments