我想创建一个带有粗体标题文本的 csv 文件。以下代码正在创建一个标题行。但我希望这个标题为粗体样式。
'Add Response header
Response.Clear()
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.csv", "check_"))
Response.Charset = ""
Response.ContentType = "application/vnd.csv"
Try
Dim sb As New StringBuilder()
'Add Header dr.GetName(count)
For count As Integer = 0 To GridView1.Columns.Count - 1
If GridView1.Columns(count) IsNot Nothing Then
sb.Append(GridView1.Columns(count).HeaderText)
End If
If count < GridView1.Columns.count - 1 Then
sb.Append(",")
End If
Next
Response.Write(sb.ToString() + vbLf)
Response.Flush()
Catch ex As Exception
Response.Write(ex.Message)
End Try
Response.[End]()