reportscriptlet.java

来自「一个很有特点的地图平台,可以以动画方试展现电子地图,有拉近,拉远,滑动功能,最主」· Java 代码 · 共 30 行

JAVA
30
字号
package mapcenter.test;

import java.util.*;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.data.*;

public class reportScriptlet extends JRAbstractScriptlet {

  public void beforeReportInit() throws JRScriptletException{}
  public void afterReportInit() throws JRScriptletException{}
  public void beforePageInit() throws JRScriptletException{}
  public void afterPageInit() throws JRScriptletException{}
  public void beforeColumnInit() throws JRScriptletException{}
  public void afterColumnInit() throws JRScriptletException{}
  public void beforeGroupInit(String string) throws JRScriptletException{}
  public void afterGroupInit(String string) throws JRScriptletException{}
  public void beforeDetailEval() throws JRScriptletException{}
    public void afterDetailEval() throws JRScriptletException {
       System.out.println("afterDetailEval...");
       List subList = (List)getFieldValue("subList");
       JRDataSource jr = new JRBeanCollectionDataSource(subList);
       /**
        *该值是在父报表中定义的一个变量Variables,
        *类型为net.sf.jasperreports.engine.JRDataSource
         *(需要手动填写Class Type)
        **/
         setVariableValue("other", jr);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?