Adding the support for data type Long and decimal.Decimal.
We wrapped the def write(self, col, label, style) of pyExcelerator.Row in the following way:
@accepts(object, int, (str, unicode, int, float, decimal.Decimal, long, dt.datetime, dt.time, dt.date, ExcelFormula.Formula), Style.XFStyle)
def write(self, col, label, style):
self.__adjust_height(style)
self.__adjust_bound_col_idx(col)
if isinstance(label, (str, unicode)):
if len(label) > 0:
self.__cells.extend([ Cell.StrCell(self, col, self.__parent_wb.add_style(style), self.__parent_wb.add_str(label)) ])
self.__total_str += 1
else:
self.__cells.extend([ Cell.BlankCell(self, col, self.__parent_wb.add_style(style)) ])
elif isinstance(label, (int, float, long, decimal.Decimal)):
self.__cells.extend([ Cell.NumberCell(self, col, self.__parent_wb.add_style(style), label) ])
elif isinstance(label, (dt.datetime, dt.time)):
self.__cells.extend([ Cell.NumberCell(self, col, self.__parent_wb.add_style(style), self.__excel_date_dt(label)) ])
else:
self.__cells.extend([ Cell.FormulaCell(self, col, self.__parent_wb.add_style(style), label) ])
bye.
Max M.
Logged In: NO
I forgot....
"and this works!"