Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1253

Copy/paste a range doesn't copy column width and row height to destination range

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • 3.8.3
    • None
    • Security Level: Jimmy
    • None
    • Sprint 6

      steps to reproduce

      1. run the attached program, it pastes a range with srcRange.paste(destRange); to another sheet

      actual result

      the custom column width and row height is not applied to the destination sheet.

      workaround

      	static void applyRowHeight(Range source, Range destination) {
      		for (int row = source.getRow() ; row <= source.getLastRow() ; row++){
      			int height = source.getSheet().getRowHeight(row);
      			CellOperationUtil.setRowHeight(destination.toCellRange(row-source.getRow(), 0), height);
      		}
      	}
      
      	static void applyColumnWidth(Range source, Range destination) {
      		for (int c = source.getColumn() ; c <= source.getLastColumn() ; c++){
      			int widthPx = source.getSheet().getColumnWidth(c);
      			CellOperationUtil.setColumnWidth(destination.toCellRange(0, c-source.getColumn()), widthPx);
      		}
      	}
      

            Unassigned Unassigned
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: