ExcelColumnName converts a column index to Excel column name (A, B, ..., Z, AA, AB, ..., ZZZ).
(index int)
| 68 | |
| 69 | // ExcelColumnName converts a column index to Excel column name (A, B, ..., Z, AA, AB, ..., ZZZ). |
| 70 | func ExcelColumnName(index int) (string, error) { |
| 71 | if index >= ExcelMaxColumn { |
| 72 | return "", errors.Errorf("index cannot be greater than %v (column ZZZ)", ExcelMaxColumn) |
| 73 | } |
| 74 | |
| 75 | var s string |
| 76 | for { |
| 77 | remain := index % 26 |
| 78 | s = string(excelLetters[remain]) + s |
| 79 | index = index/26 - 1 |
| 80 | if index < 0 { |
| 81 | break |
| 82 | } |
| 83 | } |
| 84 | return s, nil |
| 85 | } |
| 86 | |
| 87 | func convertValueToStringInXLSX(value *v1pb.RowValue) string { |
| 88 | if value == nil || value.Kind == nil { |