asp.net - How to save mschart to word from webform -


i have tried 2 days saving mschart word document. no matter do, cant save chart. have gridview, , have saved fine, not chart.

  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 system.io.stringwriter = new system.io.stringwriter()     dim ohtmltextwriter 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 memorystream = new memorystream()     chart1.saveimage(ms, chartimageformat.bmp)     dim bm system.drawing.bitmap = new system.drawing.bitmap(ms)     dim strhtmlcontent stringbuilder = new stringbuilder()      strhtmlcontent.append(bm.tostring())       response.flush()     response.end() 

try set rendertype property of chart imagetag. save page word document.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -