dhcp服务配置文件/etc/dhcpd.conf详解
2012-12-11 23:40
363 查看
//poi导出excel 保存到本地
public void exportExcel(HttpServletRequest req, HttpServletResponse resp) throws IOException{
HSSFWorkbook wb = new HSSFWorkbook();
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
resp.setContentType("application/x-download");
String filedisplay = "未匹配的产品清单.xls";
filedisplay = URLEncoder.encode(filedisplay, "UTF-8");
resp.addHeader("Content-Disposition", "attachment;filename="+ filedisplay);
HSSFSheet sheet = wb.createSheet("未匹配产品");
sheet.setColumnWidth(0, 50*160);
HSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 16);
HSSFRow row = sheet.createRow((int) 0);
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCell cell = row.createCell(0);
cell.setCellValue("产品名称");
Map<String, Object> params = new HashMap<String, Object>();
params.put("userId", this.getMember().getId());
params.put("matchabled", 0);
List<Match> matchs = this.getBeanManager().listBean(Match.class, params);
for (int i = 0; i < matchs.size(); i++) {
row = sheet.createRow((int) i + 1);
Match match = (Match) matchs.get(i);
row.createCell(0).setCellValue(match.getName());
}
try {
OutputStream out = resp.getOutputStream();
wb.write(out);
out.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
public void exportExcel(HttpServletRequest req, HttpServletResponse resp) throws IOException{
HSSFWorkbook wb = new HSSFWorkbook();
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
resp.setContentType("application/x-download");
String filedisplay = "未匹配的产品清单.xls";
filedisplay = URLEncoder.encode(filedisplay, "UTF-8");
resp.addHeader("Content-Disposition", "attachment;filename="+ filedisplay);
HSSFSheet sheet = wb.createSheet("未匹配产品");
sheet.setColumnWidth(0, 50*160);
HSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 16);
HSSFRow row = sheet.createRow((int) 0);
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCell cell = row.createCell(0);
cell.setCellValue("产品名称");
Map<String, Object> params = new HashMap<String, Object>();
params.put("userId", this.getMember().getId());
params.put("matchabled", 0);
List<Match> matchs = this.getBeanManager().listBean(Match.class, params);
for (int i = 0; i < matchs.size(); i++) {
row = sheet.createRow((int) i + 1);
Match match = (Match) matchs.get(i);
row.createCell(0).setCellValue(match.getName());
}
try {
OutputStream out = resp.getOutputStream();
wb.write(out);
out.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
相关文章推荐
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- win2003下DHCP和文件服务群集cluster详细配置过程6
- RHEL4- DHCP服务(二)配置文件的建立 推荐
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- win2003下DHCP和文件服务群集cluster详细配置过程6
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- 全局配置文件也面向服务了
- WCF 第五章 行为 通过配置文件暴露一个服务行为
- LNMP架构应用实战——Nginx服务配置文件介绍
- LINUX 服务的配置 DHCP
- PXE 自动安装物理机 (DHCP服务由路由提供, 不能再配置)
- 关于dubbo服务的xml配置文件报错的问题
- NFS网络文件系统服务配置、验证及错误解决
- 18 根据给定的配置文件启动相应的mongo服务
- Linux 下DNS主从服务配置及DHCP容灾配置
- linuxDHCP服务与配置(转)
- Linux Samba文件共享服务配置(实现与win共享)
- linux服务器配置实例<2>---配置DHCP服务
- WCF系列(二) -- 使用配置文件构建和使用WCF服务