backoffice: limit xls cell content to 32767 characters (#7056)
Total number of characters that a cell can contain: 32,767 characters source: https://support.office.com/en-nz/article/Excel-specifications-and-limits-16c69c74-3d6a-4aaf-ba35-e6eb276e8eaa
This commit is contained in:
parent
af4b73b3ad
commit
9b4e963c82
|
@ -988,6 +988,10 @@ class FormPage(Directory):
|
|||
|
||||
for i, filled in enumerate(items):
|
||||
for j, elem in enumerate(self.formpage.csv_tuple(fields, filled)):
|
||||
if elem and len(elem) > 32767:
|
||||
# xls cells have a limit of 32767 characters, cut
|
||||
# it down.
|
||||
elem = elem[:32760] + ' [...]'
|
||||
ws.write(i+1, j, elem)
|
||||
|
||||
self.output = cStringIO.StringIO()
|
||||
|
|
Loading…
Reference in New Issue