首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

JXL施用日记

2012-11-14 
JXL使用日记//创建file文件对象filenew file(generatefilename)//创建一个excel文件工作对象excelstore

JXL使用日记
   

//创建file文件对象file=new file(generatefilename);//创建一个excel文件工作对象excelstore es = new excelstore();//把file对象连接到excel对象excelconnection  ec = es.openconnection(file);//excel工作表对象excelcollection collection=ec.createdatacollection(sheetname,i,keys,maps); //创建文档集sheetwritablesheet sheet = workbook.createsheet(sheetname,sheetno);//设置报表每列的长度sheet.setcolumnview(col, 40);     //设置字体格式writablefont fontformat  = new writablefont(writablefont.createfont("宋体"),11);//设置单元格格式      writablecellformat fontcontentformat =new writablecellformat(fontformat); //设置边框fontcontentformat.setborder(jxl.format.border.all,jxl.format.borderlinestyle.thin); //设置背景色fontcontentformat.setbackground(colour.white);//定义单元格label label=new label(col,row,ckmap.getkey(),times10boldformat);//把单元格添加到sheetsheet.addcell(label);
?
 

热点排行