Hello 

Have you already resolved this issue?

Could you please share setCellFormula(sum) method code?

thanks


On Wednesday, December 5, 2012 11:45:14 AM UTC+2, sainik dutta wrote:
>
> We are facing a peculiar problem in excel generation from java. Apache poi 
> is being used to generate 
>
> the code. Some of the cells in excel contain formula. 
> For examlple one of formula is "=E16+E20+E24+E28".
>
> Real problem starts when above mentioned formula some time comes as 
> "=E16+E20+E23+E26" in the excel 
>
> and produces incorrect summation. This comes on random pattern and one 
> important thing to mention here 
>
> that from 3rd value onwards formula gets started incorrect always.
>
> Following is spceimen code being used for generating above formula,
>
>         int rowStartRole    = 0;
>         int rowCount        = 15;
>         int empTypeCount    = 3;    
>         int loopCountMax    = 4;
>
>         String columnIndex     = "E";
>         String sum        = null;
>
>         /* Loop starts */
>         for(int loopCount=0;loopCount<loopCountMax; loopCount++) {
>             if(null == sum){
>                 rowStartRole = rowCount + 1;
>                 sum= columnIndex + rowStartRole;
>             } else{
>                 rowStartRole = rowStartRole + empTypeCount + 1;
>                 sum= sum + "+" + columnIndex + rowStartRole;
>             }        
>
>         }
>         /* Loop ends */
>
>         // set the formula for cell
>         setCellFormula(sum)
>
>
> This issue is completely unpredictable and same excel file generated 
> multiple times results into 
>
> correct or incorrect excel randomly.
>
> We get this issue in production environment only though we have 
> development and UAT environment which 
>
> are replica of  production, but this issue never ever occur there.
>
> Server         :     weblogic 10.3.4
> Apache poi ver.    :    3.2
>

-- 
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Java Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/jpassion_java.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to