日期:2014-05-17 浏览次数:20484 次
XF cellXF11 = xls.NewXF();//为xls生成一个XF实例(XF是cell格式对象)
//cellXF.HorizontalAlignment = HorizontalAlignments.Centered;//设定文字居中
cellXF11.Font.FontName = "宋体";//设定字体
cellXF11.Font.Height = 14 * 14;//设定字大小(字体大小是以 1/20 point 为单位的)
cellXF11.UseBorder = true;//使用边框
cellXF11.TopLineColor = Colors.Default39;
cellXF11.TopLineStyle = 2;
cellXF11.LeftLineColor = Colors.Default39;
cellXF11.LeftLineStyle = 2;
cellXF11.RightLineColor = Colors.Default39;
cellXF11.RightLineStyle = 1;
cellXF11.BottomLineColor = Colors.Default39;
cellXF11.BottomLineStyle = 1;
cell = cells.Add(1, 2, "信息", cellXF11);//设定第一行,第二例单元格的值
cell = cells.Add(3, 3, myset.Tables[0].Rows[0]["xinxi"].ToString(), cellXF11);
//信息如果数据长度大于255会丢失多余字符