JXLS 2.4.0 excel 导出 可以运行在 JDK 1.6


重新编译程序,可以运行在 JDK 1.6 环境下,程序中有很多测试点,如 多 sheet 操作,自定义函数, 数据格式化等,导出直接运行
资源截图
代码片段和文件信息
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 
 */

/**
 * @author zwb 
 * @date 2017年7月18日
 */
public class test {
public static void main(String args[])
{
String str=“201706“;
System.out.println(str.substring(0 4));
System.out.println(str.substring(4).startsWith(“0“));

int i=Integer.parseInt(str);
System.out.println(i);

BigDecimal   bd   =   new   BigDecimal(“3.14159265“);   



float price=Float.parseFloat(“00000123“);

System.out.println(price);



DecimalFormat decimalFormat=new DecimalFormat(“.000“);//构造方法的字符格式这里如果小数不足2位会以0补足.

String p=decimalFormat.format(price);//format 返回的是字符串
System.out.println(p);

  bd   =   bd.setScale(0BigDecimal.ROUND_HALF_UP);   
  System.out.println(bd);
  
  
  DecimalFormat df8 = new DecimalFormat();  
  int number = 123456789;  
  // 设置三个一组  
  df8.setGroupingSize(3);  
  DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance();  
  // 设置小数字分隔符  
  dfs.setDecimalSeparator(‘.‘);  
  dfs.setGroupingSeparator(‘‘);  
  
  df8.setDecimalFormatSymbols(dfs);     
  System.out.println(df8.format(2220.20222));  
  df8.setGroupingUsed(false);  
  System.out.println(df8.format(2220.20222)); 
  
  
  System.out.println(isNumeric(“好的好的回电话“)); 

}

//返回 0 不是数字,1 整数 ,2 浮点小数
public static int isNumeric(String str){ 
   int ret = 0;
   Pattern pattern = Pattern.compile(“-?[0-9]+.?[0-9]+“); 
   Matcher isNum = pattern.matcher(str);
   if( !isNum.matches() ){
   ret = 0;
       return ret; 
   }
   if(str.indexOf(“.“) != -1)
   {
   ret = 2;
   }else
   {
   ret = 1;
   }
   return ret; 
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1093  2017-07-12 11:44  JexcelTemple.classpath

     文件       1195  2017-07-12 11:44  JexcelTemple.project

     文件        522  2017-07-12 11:44  JexcelTemple.settings.jsdtscope

     文件        670  2017-07-17 14:25  JexcelTemple.settingsorg.eclipse.jdt.core.prefs

     文件        495  2017-07-12 11:44  JexcelTemple.settingsorg.eclipse.wst.common.component

     文件        414  2017-07-12 11:44  JexcelTemple.settingsorg.eclipse.wst.common.project.facet.core.xml

     文件         49  2017-07-12 11:44  JexcelTemple.settingsorg.eclipse.wst.jsdt.ui.superType.container

     文件          6  2017-07-12 11:44  JexcelTemple.settingsorg.eclipse.wst.jsdt.ui.superType.name

     文件         66  2017-07-12 11:44  JexcelTemple.tern-project

     文件      25088  2017-07-21 10:16  JexcelTempleobject_collection_template.xls

     文件       3139  2017-07-20 15:54  JexcelTemplesrccommonutilsJxlsUtils.java

     文件       1226  2017-07-17 17:53  JexcelTemplesrcjxlsdemoguideEmployee.java

     文件       2383  2017-07-21 10:18  JexcelTemplesrcjxlsdemoguideobjectCollectionDemo.java

     文件      59392  2017-07-17 11:27  JexcelTemplesrcjxls-templateobject_collection_template.xls

     文件       1241  2017-07-17 11:27  JexcelTemplesrclog4j.properties

     文件       2014  2017-07-21 10:52  JexcelTemplesrc est.java

     文件        834  2017-07-12 11:44  JexcelTempleWebRootindex.jsp

     文件         39  2017-07-12 11:44  JexcelTempleWebRootmeta-INFMANIFEST.MF

     文件       4720  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclassescommonutilsJxlsUtils.class

     文件       4869  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclassesjxlsdemoguideCCBB.class

     文件       1634  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclassesjxlsdemoguideEmployee.class

     文件       3197  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclassesjxlsdemoguideobjectCollectionDemo.class

     文件        281  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclassesjxlsdemoguideSPQQKHJG.class

     文件      59392  2017-07-17 11:27  JexcelTempleWebRootWEB-INFclassesjxls-templateobject_collection_template.xls

     文件       1241  2017-07-17 11:27  JexcelTempleWebRootWEB-INFclasseslog4j.properties

     文件       2575  2017-07-21 14:04  JexcelTempleWebRootWEB-INFclasses est.class

     文件     267634  2017-07-21 13:59  JexcelTempleWebRootWEB-INFlibcommons-jexl-2.1.1.jar

     文件      61829  2017-07-21 13:59  JexcelTempleWebRootWEB-INFlibcommons-logging-1.2.jar

     文件      31605  2017-07-21 13:59  JexcelTempleWebRootWEB-INFlibcommons-logging.jar

     文件     720702  2017-07-21 13:59  JexcelTempleWebRootWEB-INFlibjxl-2.6.6.jar

............此处省略36个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)