HP Server系统安装
2010-05-09 19:35
405 查看
<%@pagecontentType="text/html;charset=GBK"errorPage="/error.jsp"%>
<jsp:useBeanid="idmServer"scope="application"class="com.***.idm.IdentityServer"/>
<%--//checks.jsp包括登录校验、idmServer/loginUrl/checkUserName变量声明、服务器是否启动、登录用户是否有超级管理员权限--%>
<%@pageimport="java.util.List"%>
<%@pageimport="com.***.idm.model.service.UIService"%>
<%@pageimport="com.***.idm.data.bo.User"%>
<%@pageimport="org.apache.poi.hssf.usermodel.*"%>
<%@pageimport="com.***.idm.data.service.SearchFilter"%>
<%@pageimport="java.io.*"%>
<%@pageimport="java.util.Date"%>
<%
String_total=request.getParameter("total");//取得记录总数
intint_total=Integer.parseInt(_total);
try{
HSSFWorkbookhssfworkbook=newHSSFWorkbook();
HSSFSheethssfsheet=hssfworkbook.createSheet();//创建sheet页
hssfworkbook.setSheetName(0,"用户列表",HSSFWorkbook.ENCODING_UTF_16);//sheet名称乱码处理
HSSFRowhssfrow=hssfsheet.createRow(0);//创建表头
HSSFCellhssfcell_title_0=hssfrow.createCell((short)0);//创建第一个单元格
hssfcell_title_0.setEncoding(HSSFWorkbook.ENCODING_UTF_16);//处理乱码
hssfcell_title_0.setCellValue("用户名");//对第一个单元格赋值
HSSFCellhssfcell_title_1=hssfrow.createCell((short)1);//创建第二个单元格子
hssfcell_title_1.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_1.setCellValue("昵称");
HSSFCellhssfcell_title_2=hssfrow.createCell((short)2);
hssfcell_title_2.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_2.setCellValue("真名");
HSSFCellhssfcell_title_3=hssfrow.createCell((short)3);
hssfcell_title_3.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_3.setCellValue("电子邮件");
HSSFCellhssfcell_title_4=hssfrow.createCell((short)4);
hssfcell_title_4.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_4.setCellValue("身份证号");
HSSFCellhssfcell_title_5=hssfrow.createCell((short)5);
hssfcell_title_5.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_5.setCellValue("所属组织");
HSSFCellhssfcell_title_6=hssfrow.createCell((short)6);
hssfcell_title_6.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_6.setCellValue("是否开通");
HSSFCellhssfcell_title_7=hssfrow.createCell((short)7);
hssfcell_title_7.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_7.setCellValue("电话");
HSSFCellhssfcell_title_8=hssfrow.createCell((short)8);
hssfcell_title_8.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_8.setCellValue("手机");
HSSFCellhssfcell_title_9=hssfrow.createCell((short)9);
hssfcell_title_9.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_9.setCellValue("说明");
booleancdn=false;
SearchFiltersf=newSearchFilter();
if(true){
sf.addCondition("''","''","''");//查询条件(全部查出)
cdn=true;
}
Listusers=null;
if(cdn==true){
try{
users=idmServer.getModelService().getUserManager().findByFilter(sf);//取得全部记录
}catch(Exceptione){
e.printStackTrace();
}
}
System.out.println("已导出数据"+users.size()+"条!");
//if(users!=null&&users.size()>0){
//out.print("true");
//}else{
//out.print("false");
//}
for(inti=1;i<=int_total;i++){
Useruser=(User)users.get(i-1);
//创建sheet新行
HSSFRowhssfrow_Name=hssfsheet.createRow(i);
//依次创建单元格,写入数据
HSSFCellhssfcell_0=hssfrow_Name.createCell((short)0);
hssfcell_0.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_0.setCellValue(user.getUserName());
HSSFCellhssfcell_1=hssfrow_Name.createCell((short)1);
hssfcell_1.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_1.setCellValue(user.getNickName());
HSSFCellhssfcell_2=hssfrow_Name.createCell((short)2);
hssfcell_2.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_2.setCellValue(user.getTrueName());
HSSFCellhssfcell_3=hssfrow_Name.createCell((short)3);
hssfcell_3.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_3.setCellValue(user.getEmail());
HSSFCellhssfcell_4=hssfrow_Name.createCell((short)4);
hssfcell_4.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_4.setCellValue(user.getCreditID());
HSSFCellhssfcell_5=hssfrow_Name.createCell((short)5);
hssfcell_5.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_5.setCellValue(user.getGroupName());
HSSFCellhssfcell_6=hssfrow_Name.createCell((short)6);
hssfcell_6.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_6.setCellValue(user.isActived());
HSSFCellhssfcell_7=hssfrow_Name.createCell((short)7);
hssfcell_7.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_7.setCellValue(user.getTel());
HSSFCellhssfcell_8=hssfrow_Name.createCell((short)8);
hssfcell_8.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_8.setCellValue(user.getMobile());
HSSFCellhssfcell_9=hssfrow_Name.createCell((short)9);
hssfcell_9.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_9.setCellValue(user.getDesc());
}
//HSSFCellStylehssfcellstyle=hssfworkbook.createCellStyle();//日期单元格格式处理
//hssfcellstyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));//m/d/yyh:mm
FileOutputStreamfileoutputstream=newFileOutputStream("D:\\用户数据\\用户列表.xls");
hssfworkbook.write(fileoutputstream);
fileoutputstream.close();
}catch(IOExceptione){
e.printStackTrace();
}catch(Exceptione){
e.printStackTrace();
}
%>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
<html>
<head>
<title>***身份服务器***IDS</title>
<linkhref="../style/style.css"type="text/css"rel=stylesheet>
<linkhref="../style/listStyle.css"type="text/css"rel=stylesheet>
<styletype=text/css>body{
margin:5px
}
</style>
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache">
<metahttp-equiv="expires"content="0">
<metahttp-equiv="keywords"content="keyword1,keyword2,keyword3">
<metahttp-equiv="description"content="Thisismypage">
<!--
<linkrel="stylesheet"type="text/css"href="styles.css">
-->
</head>
<body>
<br>
数据已全部导出!<br>
存放路径:D:\用户数据\用户列表.xls<br>
<inputtype="button"value="返回"onClick="history.go(-1);">
</body>
</html>
<jsp:useBeanid="idmServer"scope="application"class="com.***.idm.IdentityServer"/>
<%--//checks.jsp包括登录校验、idmServer/loginUrl/checkUserName变量声明、服务器是否启动、登录用户是否有超级管理员权限--%>
<%@pageimport="java.util.List"%>
<%@pageimport="com.***.idm.model.service.UIService"%>
<%@pageimport="com.***.idm.data.bo.User"%>
<%@pageimport="org.apache.poi.hssf.usermodel.*"%>
<%@pageimport="com.***.idm.data.service.SearchFilter"%>
<%@pageimport="java.io.*"%>
<%@pageimport="java.util.Date"%>
<%
String_total=request.getParameter("total");//取得记录总数
intint_total=Integer.parseInt(_total);
try{
HSSFWorkbookhssfworkbook=newHSSFWorkbook();
HSSFSheethssfsheet=hssfworkbook.createSheet();//创建sheet页
hssfworkbook.setSheetName(0,"用户列表",HSSFWorkbook.ENCODING_UTF_16);//sheet名称乱码处理
HSSFRowhssfrow=hssfsheet.createRow(0);//创建表头
HSSFCellhssfcell_title_0=hssfrow.createCell((short)0);//创建第一个单元格
hssfcell_title_0.setEncoding(HSSFWorkbook.ENCODING_UTF_16);//处理乱码
hssfcell_title_0.setCellValue("用户名");//对第一个单元格赋值
HSSFCellhssfcell_title_1=hssfrow.createCell((short)1);//创建第二个单元格子
hssfcell_title_1.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_1.setCellValue("昵称");
HSSFCellhssfcell_title_2=hssfrow.createCell((short)2);
hssfcell_title_2.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_2.setCellValue("真名");
HSSFCellhssfcell_title_3=hssfrow.createCell((short)3);
hssfcell_title_3.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_3.setCellValue("电子邮件");
HSSFCellhssfcell_title_4=hssfrow.createCell((short)4);
hssfcell_title_4.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_4.setCellValue("身份证号");
HSSFCellhssfcell_title_5=hssfrow.createCell((short)5);
hssfcell_title_5.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_5.setCellValue("所属组织");
HSSFCellhssfcell_title_6=hssfrow.createCell((short)6);
hssfcell_title_6.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_6.setCellValue("是否开通");
HSSFCellhssfcell_title_7=hssfrow.createCell((short)7);
hssfcell_title_7.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_7.setCellValue("电话");
HSSFCellhssfcell_title_8=hssfrow.createCell((short)8);
hssfcell_title_8.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_8.setCellValue("手机");
HSSFCellhssfcell_title_9=hssfrow.createCell((short)9);
hssfcell_title_9.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_title_9.setCellValue("说明");
booleancdn=false;
SearchFiltersf=newSearchFilter();
if(true){
sf.addCondition("''","''","''");//查询条件(全部查出)
cdn=true;
}
Listusers=null;
if(cdn==true){
try{
users=idmServer.getModelService().getUserManager().findByFilter(sf);//取得全部记录
}catch(Exceptione){
e.printStackTrace();
}
}
System.out.println("已导出数据"+users.size()+"条!");
//if(users!=null&&users.size()>0){
//out.print("true");
//}else{
//out.print("false");
//}
for(inti=1;i<=int_total;i++){
Useruser=(User)users.get(i-1);
//创建sheet新行
HSSFRowhssfrow_Name=hssfsheet.createRow(i);
//依次创建单元格,写入数据
HSSFCellhssfcell_0=hssfrow_Name.createCell((short)0);
hssfcell_0.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_0.setCellValue(user.getUserName());
HSSFCellhssfcell_1=hssfrow_Name.createCell((short)1);
hssfcell_1.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_1.setCellValue(user.getNickName());
HSSFCellhssfcell_2=hssfrow_Name.createCell((short)2);
hssfcell_2.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_2.setCellValue(user.getTrueName());
HSSFCellhssfcell_3=hssfrow_Name.createCell((short)3);
hssfcell_3.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_3.setCellValue(user.getEmail());
HSSFCellhssfcell_4=hssfrow_Name.createCell((short)4);
hssfcell_4.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_4.setCellValue(user.getCreditID());
HSSFCellhssfcell_5=hssfrow_Name.createCell((short)5);
hssfcell_5.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_5.setCellValue(user.getGroupName());
HSSFCellhssfcell_6=hssfrow_Name.createCell((short)6);
hssfcell_6.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_6.setCellValue(user.isActived());
HSSFCellhssfcell_7=hssfrow_Name.createCell((short)7);
hssfcell_7.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_7.setCellValue(user.getTel());
HSSFCellhssfcell_8=hssfrow_Name.createCell((short)8);
hssfcell_8.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_8.setCellValue(user.getMobile());
HSSFCellhssfcell_9=hssfrow_Name.createCell((short)9);
hssfcell_9.setEncoding(HSSFWorkbook.ENCODING_UTF_16);
hssfcell_9.setCellValue(user.getDesc());
}
//HSSFCellStylehssfcellstyle=hssfworkbook.createCellStyle();//日期单元格格式处理
//hssfcellstyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));//m/d/yyh:mm
FileOutputStreamfileoutputstream=newFileOutputStream("D:\\用户数据\\用户列表.xls");
hssfworkbook.write(fileoutputstream);
fileoutputstream.close();
}catch(IOExceptione){
e.printStackTrace();
}catch(Exceptione){
e.printStackTrace();
}
%>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
<html>
<head>
<title>***身份服务器***IDS</title>
<linkhref="../style/style.css"type="text/css"rel=stylesheet>
<linkhref="../style/listStyle.css"type="text/css"rel=stylesheet>
<styletype=text/css>body{
margin:5px
}
</style>
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache">
<metahttp-equiv="expires"content="0">
<metahttp-equiv="keywords"content="keyword1,keyword2,keyword3">
<metahttp-equiv="description"content="Thisismypage">
<!--
<linkrel="stylesheet"type="text/css"href="styles.css">
-->
</head>
<body>
<br>
数据已全部导出!<br>
存放路径:D:\用户数据\用户列表.xls<br>
<inputtype="button"value="返回"onClick="history.go(-1);">
</body>
</html>
相关文章推荐
- HP Gen8 MicroServer win7 系统安装手册(usb)
- HPserver raid和系统安装
- Windows 7系统上Domino Server 8.5.3 的安装与配置
- RedHat Server 7 单独安装图形系统 X11
- vmware中安装Ubuntu16.10server系统以及配置网络
- Windows7下安装使用HP-QC系统
- Linux系统流媒体Helix Server安装及配置
- 制作Ubuntu server 12.04及新版系统安装U盘的正确方法
- RHEL 6.5系统安装配置图解教程(rhel-server-6.5)
- Citrix License Server 系统安装指南
- u盘安装ubuntu server系统
- Ubuntu Server系统下快速安装LAMP生产环境脚本
- 在Windows XP Professional上同一分区成功安装Windows 2003 Server双系统的过程
- pxe 安装centos7.2 制作过程(hp x86 server)
- ubuntu server 14.04 LTS下搭建LAMP环境之最详细笔记之一U盘安装双系统
- win7 64位系统安装HP LaserJet 5100 PCL 6
- server2008系统安装Microsoft.NET Framework3.5
- 图解如何安装VisualSVN Server及查看系统【error】日志
- RedHat server 下安装VMWame Workstation 7.1.4 虚拟win xp sp3系统
- HP新pc server安装操作系统认不到盘问题的解决