poi导出excel
来源:互联网 发布:申请网络预约出租车 编辑:程序博客网 时间:2024/06/05 02:50
页面:
<a href="###" class="btn1 btn-search" id="upLoadButton" onclick="exportFile()"><span><em>导出</em></span></a>
js:
//导出
function exportFile() {
var data = _$.getAjaxData({
url: basePath + '/webresources/timeeffect/exportFile',
type: 'POST',
dataType: 'json',
data: getQueryParams('form')
});
if (data.success) {
_$.alert(null, "点击确定,下载导出文件!", null, function () {
window.location.href = '<%=path%>/downloader?filename=' + data.msg + '&ExportOrDownLoad=Export';
});
} else {
_$.alert(null, "导出失败", null, function () {
});
}
function exportFile() {
var data = _$.getAjaxData({
url: basePath + '/webresources/timeeffect/exportFile',
type: 'POST',
dataType: 'json',
data: getQueryParams('form')
});
if (data.success) {
_$.alert(null, "点击确定,下载导出文件!", null, function () {
window.location.href = '<%=path%>/downloader?filename=' + data.msg + '&ExportOrDownLoad=Export';
});
} else {
_$.alert(null, "导出失败", null, function () {
});
}
}//end 导出
后台:
@POST
@Path("/exportFile")
public EasyUIResult exportAll( @FormParam("province") String provicecode,
@FormParam("city") String citycode,
@FormParam("wmscode") String wmscode,
@FormParam("logistic") String logisticcode) {
EasyUIResult result = null;
TimeEffectVO timeEffectVO = new TimeEffectVO();
if (!org.apache.commons.lang3.StringUtils.isEmpty(provicecode)) {
timeEffectVO.setProvicecode(provicecode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(citycode)) {
timeEffectVO.setCitycode(citycode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(wmscode)) {
timeEffectVO.setWmscode(wmscode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(logisticcode)) {
timeEffectVO.setLogisticcode(logisticcode);
}
String exportFile = this.teService.exportFile(timeEffectVO);
if (!org.apache.commons.lang3.StringUtils.isEmpty(exportFile)) {
result = EasyUIUtils.getEasyUIResult(1, true);
result.setMsg(exportFile);
return result;
}
result = EasyUIUtils.getEasyUIResult(-1, false);
return result;
@Path("/exportFile")
public EasyUIResult exportAll( @FormParam("province") String provicecode,
@FormParam("city") String citycode,
@FormParam("wmscode") String wmscode,
@FormParam("logistic") String logisticcode) {
EasyUIResult result = null;
TimeEffectVO timeEffectVO = new TimeEffectVO();
if (!org.apache.commons.lang3.StringUtils.isEmpty(provicecode)) {
timeEffectVO.setProvicecode(provicecode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(citycode)) {
timeEffectVO.setCitycode(citycode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(wmscode)) {
timeEffectVO.setWmscode(wmscode);
}
if (!org.apache.commons.lang3.StringUtils.isEmpty(logisticcode)) {
timeEffectVO.setLogisticcode(logisticcode);
}
String exportFile = this.teService.exportFile(timeEffectVO);
if (!org.apache.commons.lang3.StringUtils.isEmpty(exportFile)) {
result = EasyUIUtils.getEasyUIResult(1, true);
result.setMsg(exportFile);
return result;
}
result = EasyUIUtils.getEasyUIResult(-1, false);
return result;
}
@Override
public String exportFile(TimeEffectVO record) {
ExcelExportInfo exportInfo = new ExcelExportInfo();
public String exportFile(TimeEffectVO record) {
ExcelExportInfo exportInfo = new ExcelExportInfo();
exportInfo.setFileName("TimeEffect_Export");
exportInfo.setSheetName("excel_headers_chinese");
exportInfo.setTitles(new String[]{"导出excel头"});
exportInfo.setTitleWidths(new int[]{30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30});
exportInfo.setDataColumns(new String[]{"excel_headers_english"});
List<TimeEffectVO> datalist = this.timeEffectDao.getViewList(record);
exportInfo.setDataList(datalist);
String result = ExcelExportUtil.Export(exportInfo);
return result;
}
return result;
}
阅读全文
0 0
- Excel POI导出excel
- POI-----POI导出Excel实例
- jsp导出excel poi
- POI导出EXCEL
- poi导出Excel
- poi导出excel
- POI 导出excel
- POI 导出excel
- POI 实现导出Excel
- java poi 导出excel
- poi 方式导出excel
- POI 导出Excel
- 使用poi导出excel
- poi导出excel
- poi导出excel实例
- 使用POI导出Excel
- POI 导出EXCEL
- 导出excel poi
- 安全防护工具之:ClamAV
- Silver Cow Party
- servlet和jsp写一个图片验证码
- 透明度,margin为负数的应用,圣杯布局,倒三角
- Android部分手机拍照上传返回为空处理,和拍照后图片压缩后保存到指定路径下
- poi导出excel
- C# FTP操作实例
- eclipse快捷键
- Mac OX 配置JDK环境变量
- 国际化问题
- JavaScript 获取鼠标点击位置坐标
- node mongodbClient
- J
- VS Code 快捷键大全