没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|其它|编辑:郝浩|2012-10-17 16:46:10.000|阅读 565 次
概述:本文给出使用Aspose.Cells for Java格式化列表对象的示例。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
本文给出使用Aspose.Cells for Java格式化列表对象的示例
[Java]
//Create a workbook.
Workbook workbook = new Workbook();
//Obtaining the reference of the default(first) worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
//Obtaining Worksheet's cells collection
Cells cells = sheet.getCells();
//Setting the value to the cells
Cell cell = cells.get("A1");
cell.putValue("Employee");
cell = cells.get("B1");
cell.putValue("Quarter");
cell = cells.get("C1");
cell.putValue("Product");
cell = cells.get("D1");
cell.putValue("Continent");
cell = cells.get("E1");
cell.putValue("Country");
cell = cells.get("F1");
cell.putValue("Sale");
cell = cells.get("A2");
cell.putValue("David");
cell = cells.get("A3");
cell.putValue("David");
cell = cells.get("A4");
cell.putValue("David");
cell = cells.get("A5");
cell.putValue("David");
cell = cells.get("A6");
cell.putValue("James");
cell = cells.get("A7");
cell.putValue("James");
cell = cells.get("A8");
cell.putValue("James");
cell = cells.get("A9");
cell.putValue("James");
cell = cells.get("A10");
cell.putValue("James");
cell = cells.get("A11");
cell.putValue("Miya");
cell = cells.get("A12");
cell.putValue("Miya");
cell = cells.get("A13");
cell.putValue("Miya");
cell = cells.get("A14");
cell.putValue("Miya");
cell = cells.get("A15");
cell.putValue("Miya");
cell = cells.get("B2");
cell.putValue(1);
cell = cells.get("B3");
cell.putValue(2);
cell = cells.get("B4");
cell.putValue(3);
cell = cells.get("B5");
cell.putValue(4);
cell = cells.get("B6");
cell.putValue(1);
cell = cells.get("B7");
cell.putValue(2);
cell = cells.get("B8");
cell.putValue(3);
cell = cells.get("B9");
cell.putValue(4);
cell = cells.get("B10");
cell.putValue(4);
cell = cells.get("B11");
cell.putValue(1);
cell = cells.get("B12");
cell.putValue(1);
cell = cells.get("B13");
cell.putValue(2);
cell = cells.get("B14");
cell.putValue(2);
cell = cells.get("B15");
cell.putValue(2);
cell = cells.get("C2");
cell.putValue("Maxilaku");
cell = cells.get("C3");
cell.putValue("Maxilaku");
cell = cells.get("C4");
cell.putValue("Chai");
cell = cells.get("C5");
cell.putValue("Maxilaku");
cell = cells.get("C6");
cell.putValue("Chang");
cell = cells.get("C7");
cell.putValue("Chang");
cell = cells.get("C8");
cell.putValue("Chang");
cell = cells.get("C9");
cell.putValue("Chang");
cell = cells.get("C10");
cell.putValue("Chang");
cell = cells.get("C11");
cell.putValue("Geitost");
cell = cells.get("C12");
cell.putValue("Chai");
cell = cells.get("C13");
cell.putValue("Geitost");
cell = cells.get("C14");
cell.putValue("Geitost");
cell = cells.get("C15");
cell.putValue("Geitost");
cell = cells.get("D2");
cell.putValue("Asia");
cell = cells.get("D3");
cell.putValue("Asia");
cell = cells.get("D4");
cell.putValue("Asia");
cell = cells.get("D5");
cell.putValue("Asia");
cell = cells.get("D6");
cell.putValue("Europe");
cell = cells.get("D7");
cell.putValue("Europe");
cell = cells.get("D8");
cell.putValue("Europe");
cell = cells.get("D9");
cell.putValue("Europe");
cell = cells.get("D10");
cell.putValue("Europe");
cell = cells.get("D11");
cell.putValue("America");
cell = cells.get("D12");
cell.putValue("America");
cell = cells.get("D13");
cell.putValue("America");
cell = cells.get("D14");
cell.putValue("America");
cell = cells.get("D15");
cell.putValue("America");
cell = cells.get("E2");
cell.putValue("China");
cell = cells.get("E3");
cell.putValue("India");
cell = cells.get("E4");
cell.putValue("Korea");
cell = cells.get("E5");
cell.putValue("India");
cell = cells.get("E6");
cell.putValue("France");
cell = cells.get("E7");
cell.putValue("France");
cell = cells.get("E8");
cell.putValue("Germany");
cell = cells.get("E9");
cell.putValue("Italy");
cell = cells.get("E10");
cell.putValue("France");
cell = cells.get("E11");
cell.putValue("U.S.");
cell = cells.get("E12");
cell.putValue("U.S.");
cell = cells.get("E13");
cell.putValue("Brazil");
cell = cells.get("E14");
cell.putValue("U.S.");
cell = cells.get("E15");
cell.putValue("U.S.");
cell = cells.get("F2");
cell.putValue(2000);
cell = cells.get("F3");
cell.putValue(500);
cell = cells.get("F4");
cell.putValue(1200);
cell = cells.get("F5");
cell.putValue(1500);
cell = cells.get("F6");
cell.putValue(500);
cell = cells.get("F7");
cell.putValue(1500);
cell = cells.get("F8");
cell.putValue(800);
cell = cells.get("F9");
cell.putValue(900);
cell = cells.get("F10");
cell.putValue(500);
cell = cells.get("F11");
cell.putValue(1600);
cell = cells.get("F12");
cell.putValue(600);
cell = cells.get("F13");
cell.putValue(2000);
cell = cells.get("F14");
cell.putValue(500);
cell = cells.get("F15");
cell.putValue(900);
//Adding a new List Object to the worksheet
ListObject listObject = sheet.getListObjects().get(sheet.getListObjects().add("A1", "F15", true));
//Adding Default Style to the table
listObject.setTableStyleType(TableStyleType.TABLE_STYLE_MEDIUM_10);
//Show Total
listObject.setShowTotals(true);
//Set the Quarter field's calculation type
listObject.getListColumns().get(1).setTotalsCalculation(TotalsCalculation.COUNT);
//Saving the Excel file
workbook.save("e:\\test\\List_Object.xlsx");
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@ke049m.cn
文章转载自:慧都控件网



接DevExpress原厂商通知,将于近日上调旗下产品授权价格,现在下单客户可享受优惠报价!
面对“数字中国”建设和中国制造2025战略实施的机遇期,中车信息公司紧跟时代的步伐,以“集约化、专业化、标准化、精益化、一体化、平台化”为工作目标,大力推进信息服务、工业软件等核心产品及业务的发展。在慧都3D解决方案的实施下,清软英泰建成了多模型来源的综合轻量化显示平台、实现文件不失真的百倍压缩比、针对模型中的大模型文件,在展示平台上进行流畅展示,提升工作效率,优化了使用体验。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@ke049m.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
半岛外围网上直营