报表计算处理类

阅读(1864) 标签: 监听接口, ireportlistener, 计算,

功能及用途:系统为程序员提供报表计算前后的监听器接口,即用报表属性中的报表侦听器类指定一个java类名,此java类必须继承com.raqsoft.report.usermodel.IReportListener,并实现beforeCalc ()afterCalc ()方法,报表计算前后的处理代码分别写在这两个方法中。

实例请参考API实例 / 自定义类 / 报表计算监听类

接口类介绍:

监听器类中可以使用报表运行环境对象、报表计算前后报表对象,因此可以在报表计算前后对报表对象进行操作。

下面是com.raqsoft.report.usermodel.IReportListener类的API文档:

 

public interface IReportListener [ Show » ]

沈建荣 [16/三月/09 05:04 下午] 已解决处理办法:在htmlTag中增加了一个calculateListener属性,用来指明用户的监听接口类名此类必须从com.runqian.report4.usermodel.AbstractCalculateListener类继承,并自己编写beforeCalculateafterCalculate方法的代码 AbstractCalculateListener类的API说明如下: public class AbstractCalculateListener implements ICalculateListener {  /** 计算报表时的上下文环境 */  protected Context context;    /** WEB应用中的Request对象 */  protected HttpServletRequest request;    /** WEB应用中的Response对象 */  protected HttpServletResponse response;    /** 计算前后的报表对象 */  protected IReport report;  /**  * 实现报表计算前的处理方法  * @throws Exception  */  public void beforeCalculate() throws Exception {  return;  }  /**  * 实现报表计算后的处理方法  * @throws Exception  */  public void afterCalculate() throws Exception {  return;  } }

 

属性:

protected com.raqsoft.report.usermodel.Context context:报表运行环境对象

protected com.raqsoft.report.usermodel.IReport report:报表对象

 

方法:

public void beforeCalc(Context ctx, IReport rpt);

说明:报表计算前的处理方法。

 

public void afterCalc(Context ctx, IReport rpt);

说明:报表计算后的处理方法。