导出所选行为excle

要实现的是将所选行导出。例如勾选这两条

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAw8AAAAxBAMAAABuaoilAAAAAXNSR0IArs4c6QAAABtQTFRF6/P/////zc3NAAAA8/Pz+Pj44ODh7e7vuLm7wFLXEAAABWpJREFUeNrtXMGO1DgQtdrSLMdOW1o4pvuAOLrk/QDQ9IjrIi134DBcAaHdK+xpPhu7ynbcndjudhwyIFeinkQTJ3a9evXK7qjZf4Ptu8BOTnK265a7+irblz11X+H+82zLAiA+d83Wsi3bDXbYxU4q234xO5Q99eLBLuaVLXs7WM8COznJ2WZ71dVsMevLntpXuP9cC4D4u/wuW9asHhCNEY0Rzc4ZcXN/f/+uMWJ1Rtz8fzgcXnwqYYTEnevt9zYu9TCZUkouyYgnH/V84ktfwgiCAD+57qb6TRnBFZPchV1Nu9N2q8znnWbEEzOx+/cb/UtjjjsnrwYHo7DfOud7RqxFDJ6IAJ5sRi3pgMfdbP4liRGpZ11tR21/6U2bYYSWiPsP3wh7xt1OHRgOmBoxguhAkWIw4cnY5Bf4powRMuZC/VSVbEYt6UBKGaMOt5fhk+QiQLwMgWBJICYYYYFwsZT28FJAMJZKGTzTTPoDGcXMBJmSTiMqA3G8PU4wAr2KvsWkZICw2WmUmjwj7KZ7mWaE4bUZDasseX087DcJIKgZtcQDzlmaEcxdWxcIJMQ5I7xfWSDDNrBiGoFklcSMDCOIO4+UEUymNII7XtRmBBFixAiJzpcjIMb+C+YR0rs5oxEaNi7rawRLaATPNAuAiGhcj+Wr9KBW14jjpEZYXfCFaUiP8czaIsWzQHhZX2LWIcsYcSbWnEevVXgbzNHVxVqpyaoJUzj3iZyqWcb4OLUbjeCujJAXaATDIlGpumnW1vkpZUo0w6o1U772hiqIAM+UymUa4RmxwZn1u4KZtQkhKUkp+IrziOUnKtyMk1cfXwCEZsTNi4eHh+cla02mBgoK11Q19GuvNSla5ai+xnHKCPaHnllfv9TUVl/n2+vB+uJ1xrb6Ot++Dvay/C6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owICaclkECF3kFVfDdJNnItpn9wVqQaXL4THoHCiwG9meXbreAIFJwEIE4/Mkje2gpODgURkNScuqeagpOW7FoGX7liXRxnmNmQxzzFoXmY2Wp+q5KSYnFCK15L4FQBcUD27urK8gz/FcA23jX/xLud5dWDjeD3Asxb/t+ZiFbxgipPi+JGhvJE4lpaUQS0KapleuK6+7sXxUgCL808GCDkb93hBbPN9YtHWuONCX8yddcRCoCkyYtmNyICFLsHZFU+CcQuPELJYVAN9wj2HGAf7qPueXYCzeOVEp1XcZpb4HykyWZCa6qFtDjDxTmtKIpvx+GcTx85nB3O+SCQj5dC5TNOW9KcxZl81qM5jgMl6fKq4dI+znDLBi/93bvhBua8qwjwLOS0Kmni2LXstSabju8QcAg4BBwCDoGhIKCdtjjTRA+ltf05zeDcu/4a4rQcAg4Bh4BDwCHgEHAIOATSQKCRhhFnwyHgEHAIOAQcAg4Bh4BDYPgItNttaMT/A6weemypSMCPAAAAAElFTkSuQmCC" alt="" />

我的前台是easyUI实现的。所以前台代码为:

{
{ id:'btn_export',
text : '导出所选行',
iconCls : 'icon-print',
handler : function() {
var arr = $('#dayrec').datagrid(
'getSelections');
if (arr.length <= 0) {
$.messager.show({
title : '温馨提示!',
msg : '至少选择一行记录进行导出!'
});
} else {
$.messager.confirm('温馨提示','确认导出?',function(r) {
if (r) {
var ids = '';
for (var i = 0; i < arr.length; i++) {
ids += arr[i].id+ ',';
}//从前台取得所选行的ids,拼接成字符串,传入后台
ids = ids.substring(0,ids.length - 1);
$('#downform').form('submit', {
url : "<%=basePath%>dayrec/exportSelected",//交给指定的url处理,后台可以接收到requestparam ids
method : "post",
onSubmit: function(param){
param.ids = ids;
},
error : function() {
$.messager.alert('温馨提示', '导出失败');
},
});
$('#dayrec').datagrid('unselectAll');
} else {
return;
} });
}
}
}

后台处理逻辑为:

@RequestMapping(value = "/exportSelected", method = RequestMethod.POST)
public @ResponseBody String exportSelectedUser(@RequestParam String ids, HttpSession session, HttpServletResponse response) {
List<Object[]> dataset = dayRecruitService.exportByid(ids);
String[] headers = new String[]{"日期","所属公司","招聘企业","面试人数","入职人数","入职率(%)","备注"};
if(dataset == null || dataset.size() < 1){
return "没有查找到相应的数据,请刷新数据后重试";
}
response.setContentType("application/vnd.ms-excel");//;charset=utf-8
response.setHeader("Content-Disposition", "attachment;filename=dayRecruit.xls");
response.setHeader("Pragma","No-cache");
response.setHeader ( "Cache-Control", "no-store");
try {
OutputStream sos = response.getOutputStream(); ExportExcelsUtil.exportExcel(headers, dataset, sos);//如果不需要额外数据exportExcel(headers,dataset, sos)
// ExportExcelsUtil.exportExcel(2,1,2,"用户信息",headers,dataset, sos);//如果不需要额外数据exportExcel(headers,dataset, sos)
response.flushBuffer();
} catch (IOException e) {
e.printStackTrace();
}
return "成功导出"+dataset.size()+"条用户数据。";
}

DayRecruitService的逻辑:

    public List<Object[]> exportByid(String ids) {

        List<Object[]> objList = new ArrayList<Object[]>();
List<DayRecruit> dayrec_list=dayRecruitDAO.findById(ids);
if(dayrec_list!=null&&dayrec_list.size()>0){
for(int i=0;i<dayrec_list.size();i++){//循环遍历查询到的数据结果列表 将每一条数据插入到对应行单元格
Object[] obj=new Object[7];
DayRecruit rec=new DayRecruit();
rec=dayrec_list.get(i);
if(rec!=null){
obj[0]=rec.getDate();
obj[1]=rec.getCustomer().getOrganization().getOrganizationName();
obj[2]=rec.getCustomer().getEnterpriseName();
obj[3]=(rec.getViewerNu())==null?"":rec.getViewerNu();
obj[4]=(rec.getEntryNu()==null)?"":rec.getEntryNu();
if(rec.getViewerNu()!=null&&rec.getEntryNu()!=null)
obj[5]=(Math.round(Double.parseDouble(rec.getEntryNu())/Double.parseDouble(rec.getViewerNu())*100))/1.0+"%";
else
obj[5]="";
obj[6]=(rec.getRemarks()==null)?"":rec.getRemarks();
objList.add(obj);
}
}
}
return objList;//返回了对应的一行一行数据
}

DayRecruitDAO后台逻辑为:

    public List<DayRecruit> findById(String ids) {
// TODO Auto-generated method stub
log.debug("get DayRecruit instance with id"+ids);
try {
List<DayRecruit> list = new ArrayList();
List arrList = new ArrayList();
if(ids == null || ids.trim().equals(""))
{return list;} StringBuffer hql = new StringBuffer(
"from DayRecruit where id in(?");
String[] id = ids.split(",");
arrList.add(id[0]);
for(int i=0;i<id.length;i++){
hql.append(",?");
arrList.add(id[i]);
}
hql.append(")");
list = (List<DayRecruit>) this.getListByHQL(-1, -1, hql.toString(),
this.toStringArray(arrList));
return list; } catch (RuntimeException re) {
// TODO: handle exception
log.debug("get failed",re);
throw re;
}
}

其中涉及到的hql语句模板是

    public List<?> getListByHQL(int nStartRow, int nRowSize, String strHQL, String... strParams){
//log.debug("HQL:" + strHQL + "\n Params:" + ArrayUtils.toString(strParams));
Query query=getSession().createQuery(strHQL);
for (int j = 0,i=0; j < strParams.length; j++) {
if(strParams[j]!=null) {
if(!strParams[j].equals("")){
query.setString(i, strParams[j]);
i++;
}
}
}
if (nRowSize > 0 && nStartRow > -1) {
query.setFirstResult((nStartRow-1)*nRowSize);
query.setMaxResults(nRowSize);
} //log.debug("BEGIN:" + DateUtils.getStrOfDateMinute());
List<?> objList = query.list();
//log.debug("END:" + DateUtils.getStrOfDateMinute()); return objList;
}

此处还涉及到了工具类  代码为:

import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import org.apache.commons.collections.map.ListOrderedMap;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFPicture;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor; public class ExportExcelsUtil {
/**
*
* @param dataset 数据
* @param out 流
*/
public static <T> void exportExcel(Collection<T> dataset, OutputStream out) {
exportExcel(0,0,0,"sheet1", null, dataset, out, "yyyy-MM-dd");
} /**
*
* @param headers 标题
* @param dataset 数据
* @param out
*/
public static <T> void exportExcel(String[] headers, Collection<T> dataset,OutputStream out) {
exportExcel(0,0,0,"sheet1", headers, dataset, out, "yyyy-MM-dd");
} /**
*
* @param headers 标题
* @param dataset 数据
* @param out
* @param pattern 日期格式
*/
public static <T> void exportExcel(String[] headers, Collection<T> dataset,OutputStream out, String pattern) {
exportExcel(0,0,0,"sheet1", headers, dataset, out, pattern);
} /**
* 导出数据
* @param colSplit 需要冻结的列数目,如果没有传0
* @param rowSplit 需要冻结的行数目,如果没有传0
* @param dataBeginIndex 数据从第几个字段开始导出,每一条的记录,如果没有传0
* @param sheetName 表格名字,sheet1的名称
* @param headers 标题
* @param dataset 数据
* @param out 输出流
*/
public static <T> void exportExcel(int colSplit,int rowSplit,int dataBeginIndex,String sheetName,String[] headers, Collection<T> dataset,OutputStream out){
exportExcel(colSplit,rowSplit,dataBeginIndex,sheetName, headers, dataset, out, null);
} /**
* 这是一个通用的方法,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式输出到指定IO设备上
* @param <T>
*
* @param title
* 表格标题名
* @param headers
* 表格属性列名数组
* @param dataset
* 1.需要显示的数据集合,集合中一定要放置符合javabean风格的类的对象。此方法支持的 javabean属性的数据类型有基本数据类型及String,Date,byte[](图片数据)
* 2.或者Map,key是string类型,value属性
* @param out
* 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
* @param pattern
* 如果有时间数据,设定输出格式。默认为"yyy-MM-dd",目前不需要
*/
@SuppressWarnings("unchecked")
public static <T> void exportExcel(int colSplit,int rowSplit,int dataBeginIndex,String title, String[] headers,Collection<T> dataset, OutputStream out, String pattern) {
// 声明一个工作薄
HSSFWorkbook workbook = new HSSFWorkbook();
String sheetName = (title == null || title.equals("")) ? "sheet1" : title;
// 生成一个表格
HSSFSheet sheet = workbook.createSheet(sheetName);
try{
if(colSplit != 0 || rowSplit != 0){
sheet.createFreezePane( colSplit, rowSplit, colSplit, rowSplit );//冻结首行(0,1,0,1);2,1
}
// 设置表格默认列宽度为15个字节
sheet.setDefaultColumnWidth((short) 15);
// 生成一个样式
HSSFCellStyle style = workbook.createCellStyle();
// 设置这些样式
style.setFillForegroundColor(HSSFColor.SKY_BLUE.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 生成一个字体
HSSFFont font = workbook.createFont();
font.setColor(HSSFColor.VIOLET.index);
font.setFontHeightInPoints((short) 12);
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
// 把字体应用到当前的样式
style.setFont(font);
style.setWrapText(true);//设置自动换行 // 生成并设置另一个样式
HSSFCellStyle style2 = workbook.createCellStyle();
style2.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index);
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style2.setBorderRight(HSSFCellStyle.BORDER_THIN);
style2.setBorderTop(HSSFCellStyle.BORDER_THIN);
style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// 生成另一个字体
HSSFFont font2 = workbook.createFont();
font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
// 把字体应用到当前的样式
style2.setFont(font2);
style2.setWrapText(true);//设置自动换行 // 声明一个画图的*管理器
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
// 定义注释的大小和位置,详见文档
//HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short) 4, 2, (short) 6, 5));
// 设置注释内容
//comment.setString(new HSSFRichTextString("可以在POI中添加注释!"));
// 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容.
//comment.setAuthor("leno"); // 产生表格标题行
HSSFRow row = sheet.createRow(0);
for (short i = 0; i < headers.length; i++) {
HSSFCell cell = row.createCell(i);
cell.setCellStyle(style);
HSSFRichTextString text = new HSSFRichTextString(headers[i]);
cell.setCellValue(text);
} // 遍历集合数据,产生数据行
Iterator<T> it = dataset.iterator();
int index = 0;
while (it.hasNext()) {
index++;
row = sheet.createRow(index);
T t = (T) it.next();
if(t instanceof Class){
// 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值
Field[] fields = t.getClass().getDeclaredFields();
for (short i = 0; i < fields.length; i++) {
HSSFCell cell = row.createCell(i);
cell.setCellStyle(style2);
Field field = fields[i];
String fieldName = field.getName();
String getMethodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
Class tCls = t.getClass();
Method getMethod = tCls.getMethod(getMethodName, new Class[] {});
Object value = getMethod.invoke(t, new Object[] {});
// 判断值的类型后进行强制类型转换
String textValue = null;
if (value instanceof byte[]) {
// 有图片时,设置行高为60px;
row.setHeightInPoints(600);
// 设置图片所在列宽度为80px,注意这里单位的一个换算
sheet.setColumnWidth(i, (short) (35.7 * 400));
// sheet.autoSizeColumn(i);
byte[] bsValue = (byte[]) value;
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 1023, 600, i, index, (short) (i+1), index+1);
anchor.setAnchorType(2);
HSSFPicture pic = patriarch.createPicture(anchor, workbook.addPicture(bsValue, HSSFWorkbook.PICTURE_TYPE_JPEG));
pic.resize();//这句话一定不要,这是用图片原始大小来显示
} else {
// 其它数据类型都当作字符串简单处理
textValue = value.toString();
} if (textValue != null){
HSSFRichTextString richString = new HSSFRichTextString(textValue);
HSSFFont font3 = workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
}
}else if(t instanceof ListOrderedMap || t instanceof HashMap){
//HashMap<String,String> map = null;
ListOrderedMap map = (ListOrderedMap) t;
Iterator<String> keys = map.keySet().iterator();
short i = 0;
while(keys.hasNext()){
HSSFCell cell = row.createCell(i);
cell.setCellStyle(style2);
String keyname = keys.next();
//此处根据keyname生成标题
Object keyValue = map.get(keyname);
String textValue = null;
if(keyValue instanceof byte[]){
// 有图片时,设置行高为60px;
row.setHeightInPoints(300);
// 设置图片所在列宽度为80px,注意这里单位的一个换算
sheet.setColumnWidth(i, (short) (35.7 * 200));
// sheet.autoSizeColumn(i);
byte[] bsValue = (byte[]) keyValue;
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 1023, 255, i, index, (short) (i+1), index+1);
anchor.setAnchorType(2);
HSSFPicture pic = patriarch.createPicture(anchor, workbook.addPicture(bsValue, HSSFWorkbook.PICTURE_TYPE_JPEG));
//pic.resize();//这句话一定不要,这是用图片原始大小来显示
}else{
textValue = keyValue.toString();
}
if (textValue != null){
HSSFRichTextString richString = new HSSFRichTextString(textValue);
HSSFFont font3 = workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
i++;
}//end while(keys.hasNext())
}else if(t instanceof Object[]){
Object[] object = (Object[])t;
//忽略前两个id字段,之后可以作为参数传入
for(int len = dataBeginIndex;len<object.length;len++){
String textValue = "";
if(object[len] != null){
textValue = object[len].toString();
}
HSSFCell cell = row.createCell(len-dataBeginIndex);
cell.setCellStyle(style2);
HSSFRichTextString richString = new HSSFRichTextString(textValue);
HSSFFont font3 = workbook.createFont();
font3.setColor(HSSFColor.BLUE.index);
richString.applyFont(font3);
cell.setCellValue(richString);
}
} }
workbook.write(out);
out.flush();
out.close();
}catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
// 清理资源 } } }
上一篇:在iptables中添加vnc访问规则


下一篇:关于sql状态值