Content overwritten on top of another when formula is applied to excel cell using Apache poi

31
August 21, 2019, at 04:40 AM

I am getting an issue of content being overwritten on top of another i.e old value and new values overlap after applying formula. And this issue only occurs Microsoft Excel 2010. How do I handle this?

I have tried refreshing the formulas for entire workbook using formula evaluator but still the issue persists.

private String applyTtlAvlFormula(final int colId, final int hrsColId)
    {   
        String ttlFormulaString = "";
        for( int i = ttlAvlContentRow; i < tableHeadStartRow+1; i++) {
            String colName1 = CellReference.convertNumToColString(hrsColId);
            String colName2 = CellReference.convertNumToColString(colId);
            ttlFormulaString += "("+colName1+String.valueOf(i)+ "*$"+colName2 +"$"+String.valueOf(i)+")";
            if (i != tableHeadStartRow){
               ttlFormulaString += "+"; 
            }
        }
        return ttlFormulaString;
    }
cell.setCellFormula(applyTtlAvlFormula(j,hrsCol));

Following are pre and post shots of the issue.

From the images it can be seen that 40 and 32 gets overlapped after applying the formula. How can this issue be resolved.

READ ALSO
Powershell as a java process on a unix system, output not displayed from cmdlet

Powershell as a java process on a unix system, output not displayed from cmdlet

I am writing an implementation for a powershell clientThis implementation is in java

46
&ldquo;[ERROR] duplicate entry: META-INF/MANIFEST.MF&rdquo; shows up when using IntelliGuard to compile

“[ERROR] duplicate entry: META-INF/MANIFEST.MF” shows up when using IntelliGuard to compile

I'm trying to use IntelliGuard plugin in IntelliJ to compile and obfuscate my jar file, but "[ERROR] duplicate entry: META-INF/MANIFESTMF " shows up when I try to build in the "Build -> Obfuscate module" window

41
Java Data Communications Frameworks and Technologies [on hold]

Java Data Communications Frameworks and Technologies [on hold]

What are some Java data communications frameworks and technologies that are available today? What do you like about it? What do you dislike about it? What features do you wish it had (eg

38