Browse Source

修复存在横纵向交叉迭代时格式化不起作用的BUG

master
jacky6024 7 years ago
parent
commit
0c2213a98d
  1. 10
      ureport2-core/src/main/java/com/bstek/ureport/build/cell/down/DownBlankCellApply.java
  2. 9
      ureport2-core/src/main/java/com/bstek/ureport/build/cell/right/RightBlankCellApply.java
  3. 7
      ureport2-core/src/main/java/com/bstek/ureport/expression/function/AvgFunction.java

10
ureport2-core/src/main/java/com/bstek/ureport/build/cell/down/DownBlankCellApply.java

@ -19,6 +19,7 @@ import java.util.List;
import com.bstek.ureport.build.BindData;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.definition.ConditionPropertyItem;
import com.bstek.ureport.model.Cell;
import com.bstek.ureport.model.Column;
import com.bstek.ureport.model.Row;
@ -56,6 +57,15 @@ public class DownBlankCellApply {
blankCell.setProcessed(true);
blankCell.setData(bindData.getValue());
blankCell.setBindData(bindData.getDataList());
blankCell.setConditionPropertyItems(cell.getConditionPropertyItems());
List<ConditionPropertyItem> conditionPropertyItems=blankCell.getConditionPropertyItems();
if(conditionPropertyItems!=null && conditionPropertyItems.size()>0){
context.getReport().getLazyComputeCells().add(blankCell);
}else{
blankCell.doFormat();
blankCell.doDataWrapCompute(context);
}
processChildrenCell(cell,blankCell,index);
return true;
}

9
ureport2-core/src/main/java/com/bstek/ureport/build/cell/right/RightBlankCellApply.java

@ -19,6 +19,7 @@ import java.util.List;
import com.bstek.ureport.build.BindData;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.definition.ConditionPropertyItem;
import com.bstek.ureport.model.Cell;
import com.bstek.ureport.model.Column;
import com.bstek.ureport.model.Row;
@ -56,6 +57,14 @@ public class RightBlankCellApply {
blankCell.setProcessed(true);
blankCell.setData(bindData.getValue());
blankCell.setBindData(bindData.getDataList());
blankCell.setConditionPropertyItems(cell.getConditionPropertyItems());
List<ConditionPropertyItem> conditionPropertyItems=blankCell.getConditionPropertyItems();
if(conditionPropertyItems!=null && conditionPropertyItems.size()>0){
context.getReport().getLazyComputeCells().add(blankCell);
}else{
blankCell.doFormat();
blankCell.doDataWrapCompute(context);
}
processChildrenCell(cell,blankCell,index);
return true;
}

7
ureport2-core/src/main/java/com/bstek/ureport/expression/function/AvgFunction.java

@ -70,8 +70,11 @@ public class AvgFunction implements Function {
}
}
}
if(size==0)size=1;
return total.divide(new BigDecimal(size), 8, BigDecimal.ROUND_HALF_UP);
if(size==0){
return null;
}else{
return total.divide(new BigDecimal(size), 8, BigDecimal.ROUND_HALF_UP);
}
}
@Override
public String name() {

Loading…
Cancel
Save