class xlscontroller{ /** * 字符串编码 */ final def encode(string value,string charset='utf-8'){ java.net.urlencoder.encode(value, charset) } def xlsexportservice def i18nkeylist = ['username','nickname'] def exportxls = { def filename = encode('东明') response.setheader("contentdisposition","attachment;filename=${filename}.xls") response.setcontenttype("application/vnd.ms-excel") def datalist = personservice.list(cache:true) def titlelist = i18nkeylist.collect{ key -> message(code:key) } xlsexportservice.genforlist(datalist,titlelist,response.outputstream) } }
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....