グリッドビューを MS Word にエクスポートし、グリッドビューのフォーマットを維持する方法はありますか? 以下のコードはグリッドビューをエクスポートするために機能しますが、フォーマットを維持する方法がわかりません。(サードパーティのソフトウェアは使用できません)
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.doc")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-word"
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
GridView1.RenderControl(hw)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.End()