1、AbstractReportFormPlugin 设置抬头对应字段 过滤,排序 标志
@Override
public void setSortAndFilter(List<SortAndFilterEvent> list)
{
super.setSortAndFilter(list);/*
for(SortAndFilterEvent event : list)
{
if("bx_kh".equals(event.getColumnName())
|| "bx_dh".equals(event.getColumnName())
|| "bx_ddzt".equals(event.getColumnName())
|| "bx_djlx".equals(event.getColumnName())
|| "bx_dh".equals(event.getColumnName())
)
{
event.setSort(true);
event.setFilter(true);
}
}*/
}
2、AbstractReportListPlugIn 处理数据时 获取到 过滤,排序信息 进行处理
//抬头过滤器
List<QFilter> headFilters = p.getFilter().getHeadFilters();
List<FilterItemInfo> items = p.getFilter().getTableHeadFilterItems();
QFilter headFilter = null;
String sortFields = p.getSortInfo();
for(QFilter item:headFilters)
{
if(headFilter ==null)
{
headFilter = item;
}else
{
headFilter = headFilter.and(item);
}
}
//System.out.println(headFilter.toString());
//System.out.println(sortFields);
if(headFilter!=null)
{
resultSet = resultSet.filter(headFilter.toString());
}
if(sortFields!=null)
{
resultSet = resultSet.orderBy(new String[] {sortFields});
}
推荐阅读