如何使用 POI SS/XSSF 转置工作表? [英] How to transpose sheet with POI SS/XSSF?

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

问题描述

我正在使用 POI XSSF API,我想转置一张纸.

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

我该怎么做?

谢谢.

推荐答案

转置,如将 A2 与 B1 和 A3 与 C1 交换(因此列变成行)?

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天全站免登陆