java实现下载带汉字的文件
2006-08-25 13:38
369 查看
我所用的是POI可在www.apace.org上下载
下面是代码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
package com.javawebdemo.struts.common.excel;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.ByteArrayOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.FileInputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.FileOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.net.URLEncoder;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.ArrayList;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.List;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.ServletOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletResponse;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.logging.Log;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.logging.LogFactory;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFCell;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFRow;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFSheet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import com.javawebdemo.struts.exception.AppException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class MakeExcelByPoi ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String readFilePath = "E:/Test/Test.xls";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private Log log = LogFactory.getLog(this.getClass().getName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private HSSFWorkbook wb = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private POIFSFileSystem fs = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private HSSFSheet sheet = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String CONTENT_TYPE = "application/vnd.ms-excel";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String creatorName = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String createdDate = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String errorMessage = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private List listBean = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public MakeExcelByPoi() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public MakeExcelByPoi(String _creatorName, String _createdDate,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
List _listBean) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.creatorName = _creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.createdDate = _createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.listBean = _listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getCreatorName() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getCreatedDate() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public List getListBean() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getMessage() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.errorMessage;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setCreatorName(String _creatorName) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.creatorName = _creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setCreatedDate(String _createdDate) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.createdDate = _createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setListBean(List _listBean) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.listBean = _listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setMessage(String _errorMessage) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.errorMessage = _errorMessage;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void execute(HttpServletResponse response) throws AppException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.info("execute is begin");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fs = new POIFSFileSystem(new FileInputStream(this.readFilePath));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb = new HSSFWorkbook(fs);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
sheet = wb.getSheetAt(0);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeAutoCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeManualCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setContentType(CONTENT_TYPE);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// response.setHeader("Content-Disposition",
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// "inline; filename=tempXls.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fileName = URLEncoder.encode("用户表.xls", "UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setHeader("Content-Disposition", "attachment; filename = "+fileName);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ServletOutputStream out = response.getOutputStream();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ByteArrayOutputStream Byteout = new ByteArrayOutputStream();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(fileOut);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileOut.close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(Byteout);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setContentLength(Byteout.size());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Byteout.writeTo(out);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
out.flush();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.debug("execute is executed");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.info(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// throw new AppException();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//throws ex;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} finally...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void writeAutoCells() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(3, 5, this.getCreatorName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(4, 5, this.getCreatedDate());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void writeManualCells() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for (int j = 0; j < listBean.size(); j++) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TestBean temBean = (TestBean) listBean.get(j);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 0, temBean.getTitle());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 1, temBean.getTypeName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 2, temBean.getPlaceName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 3, temBean.getDate());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 4, temBean.getStartTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 5, temBean.getEndTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
private void setCellValue(int row, int line, String value) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HSSFRow rows = sheet.getRow(row);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (rows == null) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rows = sheet.createRow(row);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HSSFCell cell = rows.getCell((short) line);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (cell == null) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell = rows.createCell((short) line);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell.setCellValue(value);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
private void executeTest() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fs = new POIFSFileSystem(new FileInputStream(this.readFilePath));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb = new HSSFWorkbook(fs);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
sheet = wb.getSheetAt(0);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeAutoCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeManualCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileOutputStream fileOut = new FileOutputStream("c:/workbook.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(fileOut);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileOut.close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public static void main(String[] args) throws Exception ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
MakeExcelByPoi printM = new MakeExcelByPoi();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setCreatorName("LZT");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setCreatedDate("2006/08/23");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List List = new ArrayList();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for (int j = 0; j < 3; j++) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TestBean temList = new TestBean();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setTitle("This is a Test !");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setTypeName("titleData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setPlaceName("cnTypeNameData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setDate("cnStageNameData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setStartTime("");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setEndTime("");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List.add(temList);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setListBean(List);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.executeTest();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
package com.javawebdemo.struts.common.excel;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class TestBean ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private long topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getId()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getType_id()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getTitle()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartHour()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndHour()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartMinute()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndMinute()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getPlaceId()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getNote()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getIsImportant()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getIsOutCompany()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public long getTopic_id()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartPoint()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndPoint()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getTypeName()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getPlaceName()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getView()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getSave_MainDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getSave_SainDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartTime()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndTime()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndTime(String _endTime)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endTime = _endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartTime(String _startTime)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startTime = _startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setSave_SideDate(String _save_SideDate)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.save_SideDate=_save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setSave_MainDate(String _save_MainDate)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.save_MainDate=_save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setView(String _view)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.view=_view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTypeName(String _typeName)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.typeName=_typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setPlaceName(String _placeName)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.placeName=_placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartPoint(String _startPoint)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startPoint=_startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndPoint(String _endPoint)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endPoint=_endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setId(int _id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.id = _id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setType_id(int _type_id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.type_id = _type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTitle(String _title)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.title = _title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setDate(String _date)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.date = _date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartHour(String _startHour)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startHour = _startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndHour(String _endHour)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endHour = _endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartMinute(String _startMinute)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startMinute=_startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndMinute(String _endMinute)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endMinute=_endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setPlaceId(int _placeId)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.placeId = _placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setNote(String _note)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.note = _note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setIsImportant(int _isImportant)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.isImportant = _isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setIsOutCompany(int _isOutCompany)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.isOutCompany = _isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTopic_id(long _topic_id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.topic_id = _topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public void setDeleteUrl(String deleteUrl)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.deleteUrl = deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public String getDeleteUrl()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
下面是代码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
package com.javawebdemo.struts.common.excel;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.ByteArrayOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.FileInputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.io.FileOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.net.URLEncoder;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.ArrayList;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import java.util.List;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.ServletOutputStream;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import javax.servlet.http.HttpServletResponse;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.logging.Log;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.commons.logging.LogFactory;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFCell;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFRow;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFSheet;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
import com.javawebdemo.struts.exception.AppException;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class MakeExcelByPoi ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String readFilePath = "E:/Test/Test.xls";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private Log log = LogFactory.getLog(this.getClass().getName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private HSSFWorkbook wb = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private POIFSFileSystem fs = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private HSSFSheet sheet = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String CONTENT_TYPE = "application/vnd.ms-excel";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String creatorName = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String createdDate = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String errorMessage = "";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private List listBean = null;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public MakeExcelByPoi() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public MakeExcelByPoi(String _creatorName, String _createdDate,
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
List _listBean) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.creatorName = _creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.createdDate = _createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.listBean = _listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getCreatorName() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getCreatedDate() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public List getListBean() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getMessage() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return this.errorMessage;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setCreatorName(String _creatorName) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.creatorName = _creatorName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setCreatedDate(String _createdDate) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.createdDate = _createdDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setListBean(List _listBean) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.listBean = _listBean;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setMessage(String _errorMessage) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.errorMessage = _errorMessage;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void execute(HttpServletResponse response) throws AppException ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.info("execute is begin");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fs = new POIFSFileSystem(new FileInputStream(this.readFilePath));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb = new HSSFWorkbook(fs);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
sheet = wb.getSheetAt(0);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeAutoCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeManualCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setContentType(CONTENT_TYPE);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// response.setHeader("Content-Disposition",
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// "inline; filename=tempXls.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
String fileName = URLEncoder.encode("用户表.xls", "UTF-8");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setHeader("Content-Disposition", "attachment; filename = "+fileName);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ServletOutputStream out = response.getOutputStream();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ByteArrayOutputStream Byteout = new ByteArrayOutputStream();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(fileOut);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileOut.close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(Byteout);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.setContentLength(Byteout.size());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Byteout.writeTo(out);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
out.flush();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.debug("execute is executed");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
log.info(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// throw new AppException();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//throws ex;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} finally...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void writeAutoCells() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(3, 5, this.getCreatorName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(4, 5, this.getCreatedDate());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void writeManualCells() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for (int j = 0; j < listBean.size(); j++) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TestBean temBean = (TestBean) listBean.get(j);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 0, temBean.getTitle());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 1, temBean.getTypeName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 2, temBean.getPlaceName());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 3, temBean.getDate());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 4, temBean.getStartTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
setCellValue(j + 7, 5, temBean.getEndTime());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
private void setCellValue(int row, int line, String value) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HSSFRow rows = sheet.getRow(row);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (rows == null) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rows = sheet.createRow(row);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HSSFCell cell = rows.getCell((short) line);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (cell == null) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell = rows.createCell((short) line);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cell.setCellValue(value);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
private void executeTest() ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
try ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fs = new POIFSFileSystem(new FileInputStream(this.readFilePath));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb = new HSSFWorkbook(fs);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
sheet = wb.getSheetAt(0);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeAutoCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
writeManualCells();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
FileOutputStream fileOut = new FileOutputStream("c:/workbook.xls");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wb.write(fileOut);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
fileOut.close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
} catch (Exception ex) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
System.out.println(ex.toString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public static void main(String[] args) throws Exception ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
MakeExcelByPoi printM = new MakeExcelByPoi();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setCreatorName("LZT");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setCreatedDate("2006/08/23");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List List = new ArrayList();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for (int j = 0; j < 3; j++) ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TestBean temList = new TestBean();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setTitle("This is a Test !");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setTypeName("titleData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setPlaceName("cnTypeNameData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setDate("cnStageNameData");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setStartTime("");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
temList.setEndTime("");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
List.add(temList);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.setListBean(List);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
printM.executeTest();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
package com.javawebdemo.struts.common.excel;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
public class TestBean ...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private int isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private long topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
private String endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getId()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getType_id()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getTitle()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartHour()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndHour()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartMinute()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndMinute()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getPlaceId()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getNote()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getIsImportant()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public int getIsOutCompany()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public long getTopic_id()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartPoint()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndPoint()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getTypeName()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getPlaceName()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getView()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getSave_MainDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getSave_SainDate()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getStartTime()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public String getEndTime()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndTime(String _endTime)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endTime = _endTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartTime(String _startTime)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startTime = _startTime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setSave_SideDate(String _save_SideDate)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.save_SideDate=_save_SideDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setSave_MainDate(String _save_MainDate)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.save_MainDate=_save_MainDate;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setView(String _view)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.view=_view;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTypeName(String _typeName)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.typeName=_typeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setPlaceName(String _placeName)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.placeName=_placeName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartPoint(String _startPoint)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startPoint=_startPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndPoint(String _endPoint)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endPoint=_endPoint;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setId(int _id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.id = _id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setType_id(int _type_id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.type_id = _type_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTitle(String _title)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.title = _title;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setDate(String _date)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.date = _date;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartHour(String _startHour)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startHour = _startHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndHour(String _endHour)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endHour = _endHour;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setStartMinute(String _startMinute)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.startMinute=_startMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setEndMinute(String _endMinute)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.endMinute=_endMinute;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setPlaceId(int _placeId)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.placeId = _placeId;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setNote(String _note)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.note = _note;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setIsImportant(int _isImportant)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.isImportant = _isImportant;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setIsOutCompany(int _isOutCompany)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.isOutCompany = _isOutCompany;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
public void setTopic_id(long _topic_id)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.topic_id = _topic_id;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public void setDeleteUrl(String deleteUrl)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.deleteUrl = deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
public String getDeleteUrl()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return deleteUrl;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- Java 文件上传和下载组件的设计与实现...【Pnoter】
- java实现服务器文件打包zip并下载的示例(边打包边下载)
- Java实现HTTP文件下载
- java实现-hdfs上的文件上传下载(windows)
- mongoDB——java操作mongoDB实现文件上传下载
- Java实现的SFTP(文件下载详解篇)
- Hadoop HDFS文件系统通过java FileSystem 实现上传下载等
- Java - 如何在基于Java的Web项目中实现文件上传和下载?
- java实现下载文件
- Java利用apache ftp工具实现文件上传下载和删除功能
- 【转载】Java如何实现文件打包下载功能
- java 实现文件下载
- Java 使用ftp的方式上传文件到linux,并实现删除,下载
- java实现浏览器下载文件,并解决兼容各浏览器的文件下载中文乱码
- JAVA实现FTP文件上传下载文件
- 用Java实现HTTP文件队列下载
- Java实现批量下载文件
- Java实现文件远程上传和下载
- java实现文件下载的两种方式
- java实现文件下载的两种方式