乱乱地收集

import java.text.DateFormat;
import java.text.SimpleDateFormat;
DateFormat forM = new SimpleDateFormat("yyyy-MM-dd HH:mm"); 
String tem = "项目报表"+forM.format(new Date())+".xls";

组成Where条件:
private String toWhere(Infor fm ){
StringBuffer str = new StringBuffer("");
if (null!=fm.getProjectName() && !fm.getProjectName().trim().equals("")) {
	str.append("and projectName like '%").append( fm.getProjectName().trim() ).append("%' ");
} 
if (null!=fm.getProjectCompany() && !fm.getProjectCompany().trim().equals("")) { 
	str.append("and projectCompany like '%").append( fm.getProjectCompany().trim() ).append("%' ");
} 
String str1 = sqlwhere.trim().equals("")?"":sqlwhere+" and ";
String str2 = sqlwhere.trim().equals("")?"":" where "+sqlwhere;
if(str.length()>5){
	str.delete(0, 3); //删除 and 
}
return str.toString();


<script> 
//选择报表&&生成报表 
 function exportToExcel(){
     var url = ""; 
     parent.mainFrame.document.form1.action=url;
     parent.mainFrame.document.form1.target="new";	 
     parent.mainFrame.document.form1.submit();
     //window.open(url);
}  


parent.mainFrame.document.
     getElementById("add").style.display="none"; 
parent.mainFrame.location.href=url ;


//document.getElementsByTagName(i+"_SH")[0].style.display="block";  
 	
var obj = document.getElementById(i+"_SH");
if(obj != null){
    obj.style.display="none";
    var temp = document.getElementById( value + "_" + j ) ;  
if(temp!=undefined || temp!=null){
    temp.style.display="block";
</script>


		//System.getProperty("user.dir")获取到的为bin的目录
		String fiName = System.getProperty("user.dir").replace("bin", "webapps")+request.getContextPath()+StringHelper.convertStringNull((String)ConfigInfoVO.configInfoProps.get("EXCEL_SHEEL"));
		//System.out.println(this.getServletContext().getRealPath("PmsUI")+File.separatorChar );
		File file1 = new File(fiName); // 
 

你可能感兴趣的:(JavaScript,java,Excel,J#)