以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 图表不清晰 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=121977) |
-- 作者:HJG_HB950207 -- 发布时间:2018/7/16 19:32:00 -- 图表不清晰 用如下代码,把同一窗口生存的3个图表文件保存到电子表格中,很不清晰。 请教老师,如何修改代码,把3个图表文件先保存为WMF格式,再插入到自动保存到电子文件中。 Dim b As New XLS.Book Dim t As Table = Tables("表D") Dim s As XLS.Sheet = b.Sheets(0) Dim Chart As WinForm.Chart = Forms("按科室统计").Controls("Chart1") For c As Integer = 0 To t.Cols.Count -1 \'添加列标题 s(0, c).Value = t.Cols(c).Name Next For r As Integer = 0 To t.Rows.Count - 1 \'填入数据 For c As Integer = 0 To t.Cols.Count -1 s(r +1, c).Value = t.rows(r)(c) Next Next \'s(t.rows.Count + 2,1).Value = New XLS.Picture(Chart.Image,0,0,422,258) Dim Chart1 As WinForm.Chart = Forms("按科室统计").Controls("Chart1") s(t.rows.Count + 2,1).Value = New XLS.Picture(Chart1.Image,0,0,422,258) Dim Chart2 As WinForm.Chart = Forms("按科室统计").Controls("Chart2") s(t.rows.Count + 20,1).Value = New XLS.Picture(Chart2.Image,0,0,422,258) Dim Chart3 As WinForm.Chart = Forms("按科室统计").Controls("Chart3") s(t.rows.Count + 40,1).Value = New XLS.Picture(Chart3.Image,0,0,422,258) b.Save("c:\\test.xls") Dim Proc As New Process Proc.File = "c:\\test.xls" Proc.Start()
|
-- 作者:有点蓝 -- 发布时间:2018/7/16 20:12:00 -- 保存为图片在引用
|
-- 作者:有点甜 -- 发布时间:2018/7/17 9:45:00 -- 参考
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=105467&skin=0
|