Apache的POI锁定头排 [英] Apache POI Locking Header Rows

查看:458
本文介绍了Apache的POI锁定头排的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人在那里熟悉的方式来锁定与Apache POI 3.7创建A S preadsheet行?通过锁定我的意思是,我想为列标题行,当用户通过行滚动保持可见。我创建小号preadsheet将有500行,如果列的名字总是可见的将是有益的。

Is anyone out there familiar with a way to lock a row in a spreadsheet created with Apache POI 3.7? By locking I mean that I want the title row for the columns to remain visible when the user is scrolling through the rows. My created spreadsheet will have 500 rows and it would be beneficial if the column’s names were always visible.

推荐答案

在的情况下,你需要在你可以用床单冻结任何地方任何特定行(在虚空org.apache.poi.ss.usermodel.Sheet;)(可在POI 3.7为好)

In case you need to Freeze any particular row anywhere in the sheet you can use (Within void org.apache.poi.ss.usermodel.Sheet;) (Available in POI 3.7 as well)

 Sheet.createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)

在你的情况下,如果要冻结只是你的第一个x行,那么 INT leftmostColumn,诠释topRow 部分将得到删除,您可以只使用

In your case if you want to freeze just your first x rows then the int leftmostColumn, int topRow section will get removed and you can use just

  Sheet.createFreezePane(int colSplit, int rowSplit)

例如:

  sheet1.createFreezePane(0,5); // this will freeze first five rows

这篇关于Apache的POI锁定头排的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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