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

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

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

HSSFSheet.updateFormulasForShift介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi

/**
 * Shifts columns in range [startColumn, endColumn] for n places to the right.
 * For n < 0, it will shift columns left.
 * Additionally adjusts formulas.
 * Probably should also process other features (hyperlinks, comments...) in the way analog to shiftRows method 
 * @param startRow               the row to start shifting
 * @param endRow                 the row to end shifting
 * @param n                      the number of rows to shift
 */
@Beta
@Override
public void shiftColumns(int startColumn, int endColumn, int n){ 
  HSSFColumnShifter columnShifter = new HSSFColumnShifter(this); 
  columnShifter.shiftColumns(startColumn, endColumn, n); 
  
  int sheetIndex = _workbook.getSheetIndex(this);
  short externSheetIndex = _book.checkExternSheet(sheetIndex);
  String sheetName = _workbook.getSheetName(sheetIndex);
  FormulaShifter formulaShifter = FormulaShifter.createForColumnShift(
      externSheetIndex, sheetName, startColumn, endColumn, n, SpreadsheetVersion.EXCEL97);
  updateFormulasForShift(formulaShifter); 
  // add logic for hyperlinks etc, like in shiftRows() 
}

代码示例来源:origin: org.apache.poi/poi

externSheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL97);
updateFormulasForShift(formulaShifter);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Shifts columns in range [startColumn, endColumn] for n places to the right.
 * For n < 0, it will shift columns left.
 * Additionally adjusts formulas.
 * Probably should also process other features (hyperlinks, comments...) in the way analog to shiftRows method 
 * @param startRow               the row to start shifting
 * @param endRow                 the row to end shifting
 * @param n                      the number of rows to shift
 */
@Beta
@Override
public void shiftColumns(int startColumn, int endColumn, int n){ 
  HSSFColumnShifter columnShifter = new HSSFColumnShifter(this); 
  columnShifter.shiftColumns(startColumn, endColumn, n); 
  
  int sheetIndex = _workbook.getSheetIndex(this);
  short externSheetIndex = _book.checkExternSheet(sheetIndex);
  String sheetName = _workbook.getSheetName(sheetIndex);
  FormulaShifter formulaShifter = FormulaShifter.createForColumnShift(
      externSheetIndex, sheetName, startColumn, endColumn, n, SpreadsheetVersion.EXCEL97);
  updateFormulasForShift(formulaShifter); 
  // add logic for hyperlinks etc, like in shiftRows() 
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

externSheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL97);
updateFormulasForShift(formulaShifter);

相关文章

微信公众号

最新文章

更多

HSSFSheet类方法