diff --git a/imixs-adapters-poi/src/main/java/org/imixs/workflow/poi/POIUtil.java b/imixs-adapters-poi/src/main/java/org/imixs/workflow/poi/POIUtil.java index de5a293..5c46ec5 100644 --- a/imixs-adapters-poi/src/main/java/org/imixs/workflow/poi/POIUtil.java +++ b/imixs-adapters-poi/src/main/java/org/imixs/workflow/poi/POIUtil.java @@ -111,4 +111,24 @@ public static void insertColumn(XSSFSheet sheet, int startColumn, int endColumn) } } + /** + * Resolves column and row number into a excel reference. + * + * @param col + * @param row + * @return + */ + public static String getCellReference(int col, int row) { + // convert column into letters + StringBuilder colRef = new StringBuilder(); + int temp = col; + while (temp >= 0) { + int remainder = temp % 26; + colRef.insert(0, (char) (65 + remainder)); // 65 ASCII for 'A' + temp = (temp / 26) - 1; + } + // append row number starting at 1 + return colRef.toString() + (row + 1); + } + } \ No newline at end of file