POI Excel Merging Causing “Repaired Records: Format from /xl/styles.xml part (Styles)”

微笑、不失礼 提交于 2019-12-05 07:52:18

Well, after debugging bit of POI code and how styles are being applied and so.

Doing below solved the problem

newCellStyle.getCoreXf().unsetBorderId();
      newCellStyle.getCoreXf().unsetFillId();
Yuri

I had the same issue. You should to minimize instances of styles and fonts because each instance is placed into xl/styles.xml

Make styles and fonts only once for one book.

I had the same issue using the Python library xlxswriter with Pandas. After I stopped trying to use Pandas' date_format specification, I stopped getting the error.

import pandas as pd

data = pd.read_excel('somefile.xlsx')
grp = data.groupby('Property Manager')

for i, (pm, g) in enumerate(grp):
    writer = pd.ExcelWriter(p + f.format(pm[:30]), engine='xlsxwriter') #,date_format='%m/%d/%Y')
    g[cols].to_excel(writer, sheet_name='Summary', index=False)
    writer.save()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!