Skip to content

Commit

Permalink
Fix TypeError in export to xlsx
Browse files Browse the repository at this point in the history
Closes jazzband#323.
  • Loading branch information
suchow committed Feb 24, 2018
1 parent 4c300e6 commit 13747e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tablib/formats/_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def dset_sheet(dataset, ws, freeze_panes=True):
row_number = i + 1
for j, col in enumerate(row):
col_idx = get_column_letter(j + 1)
cell = ws.cell('%s%s' % (col_idx, row_number))
cell = ws['%s%s' % (col_idx, row_number)]

# bold headers
if (row_number == 1) and dataset.headers:
Expand All @@ -129,7 +129,7 @@ def dset_sheet(dataset, ws, freeze_panes=True):
if freeze_panes:
# Export Freeze only after first Line
ws.freeze_panes = 'A2'

# bold separators
elif len(row) < dataset.width:
cell.value = unicode('%s' % col, errors='ignore')
Expand All @@ -145,5 +145,3 @@ def dset_sheet(dataset, ws, freeze_panes=True):
cell.value = unicode('%s' % col, errors='ignore')
except TypeError:
cell.value = unicode(col)


0 comments on commit 13747e9

Please sign in to comment.