diff --git a/tablib/formats/_xls.py b/tablib/formats/_xls.py index 76e9318..0e989a7 100644 --- a/tablib/formats/_xls.py +++ b/tablib/formats/_xls.py @@ -9,9 +9,12 @@ import cStringIO title = 'xls' extentions = ('xls',) + +# special styles wrap = xlwt.easyxf("alignment: wrap on") bold = xlwt.easyxf("font: bold on") + def export_set(dataset): """Returns XLS representation of Dataset.""" @@ -62,6 +65,9 @@ def dset_sheet(dataset, ws): # wrap the rest else: - ws.write(i, j, col, wrap) + if '\n' in col: + ws.write(i, j, col, wrap) + else: + ws.write(i, j, col) \ No newline at end of file