【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

接口作用

计算时动态改变单元格的值。

接口内容

CellValueProvider
package com.fr.report.fun;

import com.fr.base.Style;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.stable.fun.Level;
import com.fr.stable.script.CalculatorProvider;

/**
 * 单元格中间处理器
 */
public interface CellValueProvider extends Level{
    String MARK_STRING = "CellValueProvider";
   int CURRENT_LEVEL = 1;

   /**
    * 获取单元格的值
    * 
    * @param oriValue 单元格未计算的值
    * @param ca 算子
    * @return 返回计算后的单元格值
    */
    Object process(Object oriValue, CalculatorProvider ca);

    /**
     * 转换为html之前的处理单元格值接口
     * 例如: 单元格输出到web端不想用默认的显示方式, 想将其转为图片, 转为富文本等等.
     *
     * @param guiAttr 显示属性
     * @param height 单元格高度
     * @param oriValue 原值
     * @param style 样式
     * @param width 单元格宽度
     * @return 处理后的值
     */
    Object processBeforeToTag(Object oriValue, CellGUIAttr guiAttr, Style style, int width, int height);
}

注册方式

<extra-report>
      <CellValueProvider class="com.fr.plugin.xxx.youclassname"/>
</extra-report>
  • No labels