/**
* 演示报表Java数据集,用于扩展报表
*
*/
public class DemoDataSet extends AbstractJavaDataSet {
/**报表过滤参数**/
private Map<?, ?> filters;
/**
* 返回数据集
*/
@Override
public IRowSet[] getCustomRowSet(Window parent, String otherDataCenter) throws Exception {
// 存放数据集
IRowSet[] ds = new IRowSet[1];
String number = (String) this.filters.get("number"); //过滤参数
StringBuffer sql = new StringBuffer();
sql.append("select FNumber 登录名, FName_L2 用户实名 from T_PM_User where 1 = 1").append("\n");
if(VerifyUtil.notNull(number)){
System.out.println("过滤参数:number = " + number);
sql.append("and FNumber = '" + number + "'").append("\n");
}
IRowSet rs = DaoUtil.executeQuery(sql);
ds[0] = rs;
return ds;
}
/**
* 如需返回查询语句时,实现该方法
*/
@Override
public String getCustomSQL(Window parent) throws Exception {
return super.getCustomSQL(parent);
}
/**
* 报表过滤参数
*/
@SuppressWarnings("unchecked")
@Override
public void setFilterParam(Map filterParamMap) {
filters = filterParamMap;
}
}