Apache的POI,输出到单个列练成 [英] Apache poi, output to excel in single column

查看:152
本文介绍了Apache的POI,输出到单个列练成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要使用Apache POI导出到一个excel US preadsheet 3个不同的数组列表。我遇到的问题是他们打印到纸张格式。有没有一种方法能有的ArrayList的一个直接打印下来的一列?

I have 3 different array lists that need to be exported to a excel spreadsheet using apache poi. The problem I am having is in the format they print to the sheet. Is there a way to have one of the arraylists print straight down a single column?

推荐答案

要打印直降一列你可以试试这个code。

To print straight down a single column you can try this code.

Sheet sheet = ....;

for (int i = 0; i < array1.size(); i++) {
    Row row = sheet.createRow(i);
    Cell cell = row.createCell(0);
    cell.setCellValue(array1.get(i));
}

这篇关于Apache的POI,输出到单个列练成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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