[嵌入式Linux] 【实例】使用Java导出Excel文件

[复制链接]
发表于 2022-9-28 16:04:54
官方Java开发工程师QQ群(27163376),验证请输入您的ID。资源包括使用的XLS文件与JAR包,还有JAVA的源码。源码内全面带有标注,确保您一看就懂。HkSfaStatBCbc=newHkSfaStatBCImpl();//后台实现类--成果计算HkSfaActivityBCabc=newHkSfaActivityBCImpl();//后台实现类--统计流动Stringactivitypk=request.getParameter(activitypk);//流动PKListchildGroups=abc.getChildgroup(activitypk);//得到此流动的一切小组double[][]data=bc.problemCollect(activitypk);//得到计算成果,一个二维数组org.apache.poi.hssf.usermodel.HSSFRowrow=sheet.createRow(11);//在第一个工作表中创建一行(第12行)for(intk=0;klt;childGroups.size();k++){ApSfaGroupactivityactivityGroup=(ApSfaGroupactivity)childGroups.get(k);//ApSfaGroupactivity为流动小组的Pojoorg.apache.poi.hssf.usermodel.HSSFCellcell=row.createCell((short)(k+1));//在row中创建单元格cell.setEncoding(HSSFCell.ENCODING_UTF_16);//设置编码cell.setCellValue(activityGroup.getName());//给单元格设置值.......
导出Excel\需用到的xls文件\PicStat.xls
导出Excel\需用到的xls文件\statPic.xls
导出Excel\需求用到的Jar包\commons-io-1.1.jar
导出Excel\需求用到的Jar包\excelutils.jar
导出Excel\需求用到的Jar包\poi-3.0.1.jar
导出Excel\需求用到的Jar包\tm-extractors-0.4.jar
导出Excel\picExcel.java

(Official Java development engineer QQ group (27163376), please enter your ID for verification. Resources include used XLS files and JAR packages, as well as JAVA source code. The source code is fully marked to ensure that you can understand it at a glance. HkSfaStatBCbc=newHkSfaStatBCImpl();//Background implementation class--result calculation HkSfaActivityBCabc=newHkSfaActivityBCImpl();//Background implementation class--Statistical flow Stringactivitypk=request.getParameter(activitypk);//Flow PKListchildGroups=abc.getChildgroup(activitypk) ;//Get all groups of this flow double[][]data=bc.problemCollect(activitypk);//Get the result of calculation, a two-dimensional array org.apache.poi.hssf.usermodel.HSSFRowrow=sheet.createRow(11 );//Create a row in the first worksheet (line 12) for(intk=0;klt;childGroups.size();k  ){ApSfaGroupactivityactivityGroup=(ApSfaGroupactivity)childGroups.get(k);//ApSfaGroupactivity Pojoorg.apache.poi.hssf.usermodel.HSSFCellcell=row.createCell((short)(k 1));//Create a cell in row cell.setEncoding(HSSFCell.ENCODING_UTF_16);//Set Code cell.setCellValue(activityGroup.getName());//Set the value to the cell......
Export Excel\needed xls file\PicStat.xls
Export Excel\needed xls file\statPic.xls
Export Excel\Jar package used for requirements\commons-io-1.1.jar
Export Excel\Jar package for requirements\excelutils.jar
Export Excel\Jar package used for requirements\poi-3.0.1.jar
Export Excel\Jar package used for requirements\tm-extractors-0.4.jar
ExportExcel\picExcel.java)

[下载]16045578079.rar




上一篇:MyEclipse快捷键大全
下一篇:LinuxC函数库详解词典

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表