IreportTotal total=getModel(IreportTotal.class,"ireport");
Page<BillReport> list=BillReport.dao.getBillInfoData(total,getPageModel(), getSessionAttr("defaultorg_id").toString(),getParaToInt("BUYER_MEM_ID"),getParaToInt("order_id"));
Page<BillReport> strlist = null;
for (int i = 0; i < list.getPageSize(); i++) {
for(BillReport bill: list.getList()){
String orderId= bill.getNumber("order_id").toString();
int getOrderId=Integer.parseInt(orderId);
strlist=BillReport.dao.getBillInfoTopData(total,getPageModel(), getSessionAttr("defaultorg_id").toString(),getOrderId);
}
/* String orderId=list.getList().get(i).getNumber("order_id").toString();
int getOrderId=Integer.parseInt(orderId);
Page<BillReport> strlist=BillReport.dao.getBillInfoTopData(total,getPageModel(), getSessionAttr("defaultorg_id").toString(),getOrderId);*/
}
}
====================================================
List<Object[]> list = new ArrayList<Object[]>();
Object[] objArr = new Object[2];
Object[] objArr2 = new Object[2];
List<String> strList = new ArrayList<String>(){
{
add("AA2");
add("BB2");
add("CC2");
add("DD2");
add("EE2");
}
};
objArr[0] = "11";
objArr[1] = strList;
list.add(objArr);
List<String> strList2 = new ArrayList<String>(){
{
add("AA");
add("BB");
add("CC");
add("DD");
add("EE");
}
};
objArr2[0] = "222";
objArr2[1] = strList2;
list.add(objArr2);
Map<Object, List<String>> map = new TreeMap<Object, List<String>>();
map.put("111", strList);
map.put("222", strList2);
setAttr("map", map);
html:
<%
Map<Object,List<String>> map =(Map<Object,List<String>>)request.getAttribute("map");
Set<Object> set = map.keySet();
%>
<%
for(Object obj : set) {
response.getWriter().write("主表:" + obj);
for(String str :map.get(obj)){
response.getWriter().write("子表:" + str);
}
response.getWriter().write("<br>");
}
%>