kz26 / PyExcelerate

Accelerated Excel XLSX Writing Library for Python 2/3
https://pypi.org/project/PyExcelerate/
BSD 2-Clause "Simplified" License
530 stars 60 forks source link

I can't import excel #75

Closed Whpitot closed 4 years ago

Whpitot commented 6 years ago

when I export data to excel , i get a exception as follow:

File "/usr/lib/python2.7/site-packages/pyexcelerate/Worksheet.py", line 265, in get_xml_data row_data.append(self.get_cell_data(cell, x, y, style)) File "/usr/lib/python2.7/site-packages/pyexcelerate/Worksheet.py", line 197, in get_cell_data return "<c r=\"%s%s" % (Range.Range.coordinate_to_string((x, y)), z) UnboundLocalError: local variable 'z' referenced before assignment

kevmo314 commented 6 years ago

Do you have a code sample to reproduce the issue?

Whpitot commented 6 years ago

I have solved this issue.

I debug the source code(Worksheet.py, line 197). I found one of the value in cells is {"pay_mode":"到付(客户承担)","consignee":"","insurance_money":"0.00","is_insured":"B"}

The type of value is not support in type = DataTypes.get_type(cell) (Worksheet.py, ine 176)

so, I can't get the value of z, this throw a exception as above mentioned.

can you understand me?

kevmo314 commented 4 years ago

I've addressed this in fcd0d7a6d9b995ee89e2dc7ce01caf9eaed308d0.