xlwt设置样式制作错误:超过4094 XF(样式) [英] xlwt set style making error: More than 4094 XFs (styles)

查看:1388
本文介绍了xlwt设置样式制作错误:超过4094 XF(样式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Xlwt编写一个excel文件。当我使用XFStyle并设置边框和其他attr的样式时,它的单元格具有一些样式(颜色,对齐,边框,...)



,在某些情况下会产生错误:
超过4094 XF(样式)



为什么?
我该怎么办这个错误?



谢谢

解决方案



我找到解决方案:

  wb = xlwt.Workbook(style_compression = 2)

use:style_compression = 2



其工作!


I use Xlwt for writing an excel file. it's cells has some style (color, alignment ,borders , ... )

when i use XFStyle and set borders and other attr of style, in some cases it make error: More than 4094 XFs (styles)

why? what should i do with this error?

thanks

解决方案

I read and trace functions and methods that calls during execution.

i find solution:

wb = xlwt.Workbook(style_compression=2)

use : style_compression=2

its work!

这篇关于xlwt设置样式制作错误:超过4094 XF(样式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆