Я пытался в течение 2 дней сохранить mschart в текстовый документ.Что бы я ни делал, я не могу сохранить график.У меня есть сетка, и я сохранил это прекрасно, но не график.
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=FileName.doc")
Response.ContentEncoding = System.Text.Encoding.Default
Response.ContentType = "application/vnd.word"
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter()
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
' Chart1.SaveImage("C:\temp\chart.jpg", ChartImageFormat.Jpeg)
' GridView1.DataBind()
GridView33.RenderControl(oHtmlTextWriter)
Response.Output.Write(oStringWriter.ToString())
Response.Output.Write(oStringWriter)
'the chart part
Chart1.SaveImage(Server.MapPath("\WebCharts\Chart.Jpeg"))
Dim ms As MemoryStream = New MemoryStream()
Chart1.SaveImage(ms, ChartImageFormat.Bmp)
Dim bm As System.Drawing.Bitmap = New System.Drawing.Bitmap(ms)
Dim strHTMLContent As StringBuilder = New StringBuilder()
strHTMLContent.Append(bm.ToString())
Response.Flush()
Response.End()