📄 reportscriptlet.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -