标签:
atitit.导出excel的设计----查询结果 导出为excel的实现java .net php 总结
查询获得list
读取jsp的table获得标题and 字段的map
toexcel(map,list)
_meth=sql dwr 的元数据
_metadata=xxxx
reqDatas....
作者:: 老哇的爪子 Attilax 艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
prj:wechatadm4prp
Command.reg("export", new Closure2() {
@Override
public Object execute(Object arg0) {
Map m2 = convert2atiormMap(m);
Object sql = new OrmX().convert2sql(JsonX.toJsonStrO88(m2));
Hbx hbx = AaaCfg.IocX.getBean(Hbx.class);
try {
List li = hbx.exe(sql);
Map m3=new HashMap ();
m3.put("size", li.size());
JSONObject metadata = JSONObject.fromObject(m.get("_metadata"));
String jsppath=metadata.getString("titleMapFile");
List<Map> titlesMap=HtmlX.getTitlesMap(jsppath,"tabid1", "utf-8");
m3.put("url", geneExportExcel(li,titlesMap));
return m3;
} catch (SQLGrammarException e) {
filex.saveLog(sql.toString(), "c:\\e");
throw new RuntimeException(sql.toString(), e);
}
// return s;
}
});
protected Object geneExportExcel(List list, List<Map> titlesMap) {
String fileName=filex.getUUidName()+".xls";
String f=pathx.webAppPath()+"\\uploadf\\"+fileName;
excelUtil.toExcel(titlesMap, list, f);
return "uploadf/"+fileName;
}
atitit.导出excel的设计----查询结果 导出为excel的实现java .net php 总结
标签:
原文地址:http://blog.csdn.net/attilax/article/details/44284743