Excel绘画

来源:互联网 发布:陈默软件 编辑:程序博客网 时间:2024/04/28 10:33

Sheet.Cells[i,j]  其中i代表行,j代表列

Sheet.Cell[1,1]代表第一个单元格 

 

 

SpreadsheetClass Sheet = new SpreadsheetClass();

//绘画第一行的标题

 Sheet.get_Range(Sheet.Cells[1, 1], Sheet.Cells[4, j]).set_VerticalAlignment(XlVAlign.xlVAlignCenter);

//标题行加粗字体
Sheet.get_Range(Sheet.Cells[1, 1], Sheet.Cells[1, 1]).Font.set_Bold(true);
 //设置字体大小  
Sheet.get_Range(Sheet.Cells[1, 1], Sheet.Cells[1, 1]).Font.set_Size(14);
Sheet.get_Range(Sheet.Cells[2, 1], Sheet.Cells[4, ds.Tables[0].Rows.Count + 2]).Font.set_Size(11);
//背景色
Sheet.get_Range(Sheet.Cells[2, 1], Sheet.Cells[2, ds.Tables[0].Rows.Count + 2]).Interior.set_ColorIndex(43);
原创粉丝点击