Please find the below code i have tried.
Workbook workbook = new Workbook();
// Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Setting the name of the newly added worksheet
worksheet.Name = "Top_10_Errors";
worksheet.Cells.ImportDataTable(dt, true, "A2");
// Create a Cells object ot fetch all the cells.
Cells cells = worksheet.Cells;
// Merge some Cells (C6:E7) into a single C6 Cell.
cells.Merge(0, 0, 1, 2);
// Input data into C6 Cell.
worksheet.Cells["A1"].PutValue("Top 10 Errors-EXCEL");
// Create a Style object to fetch the Style of C6 Cell.
Style style = worksheet.Cells["A1"].GetStyle();
// Create a Font object
Font font = style.Font;
// Set the name.
font.Name = "Times New Roman";
// Set the font size.
font.Size = 14;
// Set the font color
font.Color = System.Drawing.Color.Black;
// Bold the text
font.IsBold = true;
// Set the backgrond color of C6 Cell to Red
// style.ForegroundColor = System.Drawing.Color.Red;
//style.Pattern = BackgroundType.Solid;
style.VerticalAlignment = TextAlignmentType.Center;
style.HorizontalAlignment = TextAlignmentType.Center;
//style.SetBorder(BorderType.BottomBorder, CellBorderType.DashDotDot, System.Drawing.Color.Black);
// Apply the Style to C6 Cell.
cells["A1"].SetStyle(style);
//Cells cells1 = worksheet.Cells;
Style style1 = cells["A2"].GetStyle();
// Create a Font object
Font font1 = style1.Font;
// Set the name.
font1.Name = "Times New Roman";
// Set the font size.
font1.Size = 14;
// Set the font color
font1.Color = System.Drawing.Color.Black;
// Bold the text
font1.IsBold = true;
style1.Pattern = BackgroundType.Solid;
//style1.BackgroundColor = System.Drawing.Color.LightBlue;
style1.ForegroundColor = System.Drawing.Color.LightBlue;
Style style2 = cells["B2"].GetStyle();
// Create a Font object
Font font2 = style2.Font;
// Set the name.
font2.Name = "Times New Roman";
// Set the font size.
font2.Size = 14;
// Set the font color
font2.Color = System.Drawing.Color.Black;
// Bold the text
font2.IsBold = true;
style1.Pattern = BackgroundType.Solid;
// style2.BackgroundColor = System.Drawing.Color.LightBlue;
style2.ForegroundColor = System.Drawing.Color.LightBlue;
cells["A2"].SetStyle(style1);
cells["B2"].SetStyle(style2);
//Cells cells2 = workbook.Worksheets[0].Cells;
Range range1 = cells.CreateRange("A1", "B12");
Style stl = workbook.CreateStyle();
stl.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
stl.Borders[BorderType.TopBorder].Color = System.Drawing.Color.Black;
stl.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;
stl.Borders[BorderType.LeftBorder].Color = System.Drawing.Color.Black;
stl.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
stl.Borders[BorderType.BottomBorder].Color = System.Drawing.Color.Black;
stl.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;
stl.Borders[BorderType.RightBorder].Color = System.Drawing.Color.Black;
StyleFlag flg = new StyleFlag();
flg.Borders = true;
range1.ApplyStyle(stl, flg);
worksheet.Cells["A14"].PutValue("Downloaded Date and Time:");
worksheet.Cells["B14"].PutValue(Convert.ToDateTime(DateTime.Now).ToString("dd-MMM-yyyy@HH.mm.ss"));
worksheet.Cells["A16"].PutValue("Downloaded By:");
worksheet.Cells["B16"].PutValue("Nagesh Kotha");
// Saving the Excel file
worksheet.AutoFitColumns();
workbook.Save(m_DownloadFolder + filename);
please refer uploaded the screenshot,actually i need like that
final_output_like_this.PNG (4.1 KB)