java生成日报表代码 java生成表格( 二 )


private static List list=null;
private static Integer startRow;
private static Integer ncurrentPage;
【java生成日报表代码 java生成表格】private static Integer cell;
private static String property;
private static String sql;
private static String type;
private static String condition ;//是否导出当前页
private static String currentPage;
private static String from ;
private static String pactdata;
private static String voyagename;
private static String voyageno;
private static String dwt ;
private static String hirefrom ;
private static String deliveryposion ;
private static String redeliveryposion ;
private static String sheepowner ;
private static String addr;
private static String addcomm;
private static String rent;
private static String fileName ;
private static OutputStream os;
@Override
public ActionForward findAll(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
return null;
}
@Override
public ActionForward findById(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
return null;
}
@Override
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
return null;
}
public static String strNull(Object nullStr,String newStr,Integer cell){
if(nullStr==null||nullStr.equals("")){return newStr;}else{cell+=1;return nullStr+"";}
}
public static String getStr(String str,Integer cell){
if(str==null||str.trim().equals("")){return "";}else{cell+=1;return ","+str;}
}
public static String getExcelTile(String title){
if(title==null)
return "";
if(title.equals("modela.stsid"))
return "编号";
if(title.equals("modelc.pactdata"))
return "合同日期";
if(title.equals("modela.voyagename"))
return "航名";
if(title.equals("modela.voyageno"))
return "航次";
if(title.equals("modelc.dwt"))
return "DWT";
if(title.equals("modelc.hirefrom"))
return "受载期";
if(title.equals("modela.deliveryposion"))
return "交船地点";
if(title.equals("modela.redeliveryposion"))
return "还船地点";
if(title.equals("modelc.sheepowner"))
return "联系人";
if(title.equals("modelc.addr"))
return "经纪人拥金";
if(title.equals("modelc.addcomm"))
return "ADD COMM";
if(title.equals("modelc.rent"))
return "租金";
return "";
}
public ActionForward exporVoyagesInfoToExcel(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
list=null;
startRow=0;
ncurrentPage=1;
cell=0;
type =request.getParameter("type");
condition =request.getParameter("condition");//是否导出当前页
currentPage =request.getParameter("currentPage");
from =request.getParameter("from");
pactdata = https://www.04ip.com/post/request.getParameter("modelc.pactdata");
voyagename = request.getParameter("modela.voyagename");
voyageno = request.getParameter("modela.voyageno");
dwt = request.getParameter("modelc.dwt");
hirefrom = request.getParameter("modelc.hirefrom");
deliveryposion = request.getParameter("modela.deliveryposion");
redeliveryposion = request.getParameter("modela.redeliveryposion");
sheepowner = request.getParameter("modelc.sheepowner");
addr = request.getParameter("modelc.addr");
addcomm = request.getParameter("modelc.addcomm");
rent = request.getParameter("modelc.rent");
if(type!=nulltype.trim().equals("1")){

推荐阅读