org.apache.poi.hssf.usermodel.HSSFSheet.setRowBreak()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFSheet.setRowBreak()方法的一些代码示例,展示了HSSFSheet.setRowBreak()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFSheet.setRowBreak()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFSheet
类名称:HSSFSheet
方法名:setRowBreak

HSSFSheet.setRowBreak介绍

[英]Sets a page break at the indicated row Breaks occur above the specified row and left of the specified column inclusive. For example, sheet.setColumnBreak(2); breaks the sheet into two parts with columns A,B,C in the first and D,E,... in the second. Simuilar, sheet.setRowBreak(2); breaks the sheet into two parts with first three rows (rownum=1...3) in the first part and rows starting with rownum=4 in the second.
[中]在指定行上方和指定列左侧(包括指定列)的指定换行符处设置分页符。例如,sheet.setColumnBreak(2);将工作表分成两部分,第一部分是A、B、C列,第二部分是D、E、,。。。在第二个。Simuilar,sheet.setRowBreak(2);将工作表分成两部分,第一部分为前三行(rownum=1…3),第二部分为以rownum=4开头的行。

代码示例

代码示例来源:origin: com.haulmont.yarg/yarg

protected void copyPageBreaks(HSSFSheet templateSheet, HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex) {
  int[] rowBreaks = templateSheet.getRowBreaks();
  for (int rowBreak : rowBreaks) {
    if (rowBreak == templateRowIndex) {
      resultSheet.setRowBreak(resultRowIndex);
      break;
    }
  }
}

代码示例来源:origin: cuba-platform/yarg

protected void copyPageBreaks(HSSFSheet templateSheet, HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex) {
  int[] rowBreaks = templateSheet.getRowBreaks();
  for (int rowBreak : rowBreaks) {
    if (rowBreak == templateRowIndex) {
      resultSheet.setRowBreak(resultRowIndex);
      break;
    }
  }
}

相关文章

微信公众号

最新文章

更多

HSSFSheet类方法