1
var excel = new ActiveXObject("Excel.Application"); //创建AX对象excel
2
excel.visible =true; //设置excel可见属性
3
var workbook = excel.Workbooks.Add; //获取workbook对象
4
var sheet1 = xlBook.Worksheets(2); //创建sheet1
5
var sheet2 = xlBook.Worksheets(1); //创建sheet2
6
sheet1.Range(sheet1.Cells(1,1),sheet1.Cells(1,14)).mergecells=true; //合并单元格
7
sheet1.Range(sheet1.Cells(1,1),sheet1.Cells(1,14)).value="员工月考核成绩"; //设置单元格内容
8
sheet1.Range(sheet1.Cells(1,1),sheet1.Cells(1,14)).Interior.ColorIndex=6;//设置底色
9
sheet1.Range(sheet1.Cells(1,1),sheet1.Cells(1,14)).Font.ColorIndex=5;//设置字体色
10
sheet1.Rows(1).RowHeight = 20; //设置列高
11
sheet1.Rows(1).Font.Size=16; //设置文字大小
12
sheet1.Rows(1).Font.Name="宋体"; //设置字体
13
//设置每一列的标题
14
sheet1.Cells(2,1).Value="工程师考核项";
15
sheet1.Cells(2,2).Value="总分";
16
sheet1.Cells(2,3).Value="研发进度";
17
sheet1.Cells(2,4).Value="出勤率";
18
sheet1.Cells(2,5).Value="执行力";
19
sheet1.Cells(2,6).Value="责任心";
20
sheet1.Cells(2,7).Value="工作规范";
21
sheet1.Cells(2,8).Value="协作精神";
22
sheet1.Cells(2,9).Value="进取性";
23
sheet1.Cells(2,10).Value="工作合理性";
24
sheet1.Cells(2,11).Value="解决问题能力";
25
sheet1.Cells(2,12).Value="应变能力";
26
sheet1.Cells(2,13).Value="人际技能";
27
sheet1.Cells(2,14).Value="理解能力";
28
//从表单循环控件中取出数据逐行插入对应列的数据
29
var count = sfform.GetAttributeValue('Repeat','Count');
30
http://www.blogjava.net/beyondduke/archive/2006/08/05/61911.html
相关文章: