worksheet.Cells[1, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
worksheet.Cells[1, 1].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
worksheet.Cells[1, 4, 1, 5].Merge =
true
;
worksheet.Cells.Style.WrapText =
true
;
worksheet.Cells[1, 1].Style.Font.Bold =
true
;
worksheet.Cells[1, 1].Style.Font.Color.SetColor(Color.White);
worksheet.Cells[1, 1].Style.Font.Name =
"微软雅黑"
;
worksheet.Cells[1, 1].Style.Font.Size = 12;
worksheet.Cells[1, 1].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(191, 191, 191));
worksheet.Cells[1, 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
worksheet.Cells[1, 1].Style.Border.Bottom.Color.SetColor(Color.FromArgb(191, 191, 191));
worksheet.Cells.Style.ShrinkToFit =
true
;
worksheet.Row(1).Height = 15;
worksheet.Row(1).CustomHeight =
true
;
worksheet.Column(1).Width = 15;
worksheet.View.ShowGridLines =
false
;
worksheet.Cells.Style.Fill.PatternType = ExcelFillStyle.Solid;
worksheet.Cells.Style.Fill.BackgroundColor.SetColor(Color.LightGray);
worksheet.BackgroundImage.Image = Image.FromFile(
@"firstbg.jpg"
);
ExcelPicture picture = worksheet.Drawings.AddPicture(
"logo"
, Image.FromFile(
@"firstbg.jpg"
));
picture.SetPosition(100, 100);
picture.SetSize(100, 100);
ExcelShape shape = worksheet.Drawings.AddShape(
"shape"
, eShapeStyle.Rect);
shape.Font.Color = Color.Red;
shape.Font.Size = 15;
shape.Font.Bold =
true
;
shape.Fill.Style = eFillStyle.NoFill;
shape.Border.Fill.Style = eFillStyle.NoFill;
shape.SetPosition(200, 300);
shape.SetSize(80, 30);
shape.Text =
"test"
;
worksheet.Hidden = eWorkSheetHidden.Hidden;
worksheet.Column(1).Hidden =
true
;
worksheet.Row(1).Hidden =
true
;