Extra redundant row after export to excel
I'm experiencing a slight problem here. I'm exporting my GridView data into excel, but the first row is usually filled with 2 redundant characters. Please help me have a look at it, is there anything wrong with this piece of code? Thank you!
Dim sw As New StringWriter
Dim htw As New HtmlTextWriter(sw)
Dim strHtml As String = sw.ToString.Trim
Dim ExcelFileName As String = "New Employee Email Details.xls"
Dim FilePhysicalPathName = Request.PhysicalApplicationPath
Dim objectExcelFileName As String = Path.Combine(FilePhysicalPathName, ExcelFileName)
If File.Exists(objectExcelFileName) Then
Dim fs As New FileStream(objectExcelFileName, FileMode.Create)
Dim bw As New BinaryWriter(fs, Encoding.Default)