forked from MDCPS/DamageAssessment_Backend
fixed survey issue in response level, and added logic for start and end date as optional date.
This commit is contained in:
@ -218,16 +218,16 @@ namespace DamageAssesment.Api.Responses.Controllers
|
||||
return NoContent();
|
||||
}
|
||||
/// <summary>
|
||||
/// Export surveys based on role .
|
||||
/// Export all survey response data based on survey id.
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
|
||||
[Route("responses/surveys/export")]
|
||||
public async Task<ActionResult> GetExcelSurveysAsync(string language,bool IsAdmin=false)
|
||||
[Route("responses/surveys/export/{surveyid}")]
|
||||
public async Task<ActionResult> GetExcelSurveysAsync(int surveyid, string language, bool IsAdmin = false)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.ExportSurveyResponsesAsync(language, IsAdmin);
|
||||
if (result.IsSuccess)
|
||||
var result = await this.surveyResponseProvider.ExportSurveyResponsesAsync(surveyid, language, IsAdmin);
|
||||
if (result.IsSuccess && result.surveyResponses.Count > 0)
|
||||
{
|
||||
|
||||
byte[] fileContents = excelExportService.ExportToExcel<object>(result.surveyResponses);
|
||||
return File(fileContents, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "data.xlsx");
|
||||
//return Ok(result.Surveys);
|
||||
|
Reference in New Issue
Block a user