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

Support to get last column/row which contains data

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 3.8.3
    • 3.8.1
    • None
    • Security Level: Jimmy
    • None

      Users wants to know the last column that contains data in a sheet.
      Like http://www.zkoss.org/javadoc/latest/zss/org/zkoss/zss/api/model/Sheet.html#getLastRow--

      workaround

      	public void findLastDataRowCol() {
      		lastRowIndex = sheet.getLastRow();
      
      		Iterator iterator = sheet.getInternalSheet().getRowIterator();
      
      		for (SRow srow : iterator) {
      			int currentLastColumn = sheet.getLastColumn(srow.getIndex());
      			if (currentLastColumn > lastColumnIndex) {
      				lastColumnIndex = currentLastColumn;
      			}
      		}
      	}
      

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

              Created:
              Updated:
              Resolved: