poi移动列和删除列
zy_9506:
为什么我用的 poi-5.0.0 里的shiftColumns 方法和你贴出来的不一样 [code=java]
/**
* 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 startColumn the column to start shifting
* @param endColumn the column to end shifting
* @param n the number of columns 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 = FormulaShift
[/code]
|