added render \n
This commit is contained in:
parent
b25bf04498
commit
8567060e1b
@ -52,7 +52,6 @@ func WriteDataToExcel(buffer io.Writer, questions []model.Question, answers []mo
|
||||
sort.Slice(answers, func(i, j int) bool {
|
||||
return answers[i].QuestionId < answers[j].QuestionId
|
||||
})
|
||||
|
||||
standart, results := categorizeAnswers(answers)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
@ -147,7 +146,25 @@ func handleAnswer(file *excelize.File, sheet, cell, s3Prefix string, answer mode
|
||||
|
||||
for cnt, cel := range todoMap {
|
||||
if _, ok := noAccept[cnt]; !ok {
|
||||
if err := file.SetCellValue(sheet, cel, cnt); err != nil {
|
||||
cntArr := strings.Split(cnt, "`,`")
|
||||
resultCnt := cnt
|
||||
if len(cntArr) > 1 {
|
||||
resultCnt = strings.Join(cntArr, "\n")
|
||||
}
|
||||
|
||||
if len(resultCnt) > 1 && resultCnt[0] == '`' && resultCnt[len(resultCnt)-1] == '`' {
|
||||
resultCnt = resultCnt[1 : len(resultCnt)-1]
|
||||
}
|
||||
|
||||
if len(resultCnt) > 1 && resultCnt[0] == '`' {
|
||||
resultCnt = resultCnt[1:]
|
||||
}
|
||||
|
||||
if len(resultCnt) > 1 && resultCnt[len(resultCnt)-1] == '`' {
|
||||
resultCnt = resultCnt[:len(resultCnt)-1]
|
||||
}
|
||||
|
||||
if err := file.SetCellValue(sheet, cel, resultCnt); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
}
|
||||
@ -229,8 +246,8 @@ func handleImage(file *excelize.File, sheet, cell, content string, count, row in
|
||||
todoMap[imgContent] = cell
|
||||
}
|
||||
|
||||
descriptionsStr := strings.Join(descriptions, "`,`")
|
||||
linkText := fmt.Sprintf("%s, Приложение: %s!A%d", descriptionsStr, mediaSheet, mediaRow)
|
||||
descriptionsStr := strings.Join(descriptions, "\n")
|
||||
linkText := fmt.Sprintf("%s\n Перейти в приложение", descriptionsStr)
|
||||
|
||||
if err := file.SetCellValue(sheet, cell, linkText); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user