如何在导出excel中添加边框

我需要下载excel文件列表视图。 我正在使用下面的代码

public static void ExportListViewAsExcel(Page currentPage, ListView lstviewControlId, string excelName) { string str = "attachment; filename=" + excelName + "-" + DateTime.Now.ToString("dd_MM_yyyy_hh_mm_tt") + ".xls"; currentPage.Response.ClearContent(); currentPage.Response.AddHeader("content-disposition", str); currentPage.Response.ContentType = "application/ms-excel"; StringWriter writer = new StringWriter(); HtmlTextWriter writer2 = new HtmlTextWriter(writer); HtmlForm child = new HtmlForm(); lstviewControlId.Parent.Controls.Add(child); child.Attributes["runat"] = "server"; child.Controls.Add(lstviewControlId); child.RenderControl(writer2); currentPage.Response.Write(writer.ToString()); currentPage.Response.End(); } 

它的出口成功。 但是,虽然打开它,它不包含边界。 它完全白色的背景。

  1. 我需要边框。
  2. 还要设置行的宽度和高度。
  3. 之前我有16位数字的银行账号。 它显示科学。 我需要显示这是因为它是16位数前面0。

    如何实现它。 帮我