如何用POI SS / XSSF调换纸张? [英] How to transpose sheet with POI SS/XSSF?

查看:197
本文介绍了如何用POI SS / XSSF调换纸张?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用POI XSSF API,我想转移一张表。



我该怎么做?


$ b $

解决方案

转置,如B1和A3与交换A2一样(列成行)?



如果是这样,没有内置的,所以你需要自己做一点编码。您可能想要抓住一对单元格,保存一个(值和样式)的内容,将第二个复制到第一个单元格,然后覆盖第二个。



如果您不确定所有的阅读/写作部分,请参阅快速指南


I am using POI XSSF API and I would like to transpose a sheet.

how can I do that?

Thanks.

解决方案

Transpose, as in swap A2 with B1 and A3 with C1 (so columns become rows)?

If so, there's nothing built in, so you'd need to do a little bit of coding yourself. You'd likely want to grab a pair of cells, save the contents of one (value and style), copy the second to the first, then overwrite the second.

See the quick guide if you're not sure on all the reading/writing parts.

这篇关于如何用POI SS / XSSF调换纸张?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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