窗口 “按科室统计“ 中 有表“分类统计表” 和图表
chart1
导出电子表(多层表头)按如下代码:
Dim dlg As new SaveFileDialog
dlg.Filter = "Excel|*.xls;*.xlsx"
If dlg.ShowDialog = DialogResult.OK Then
CurrentTable.SaveExcel(dlg.FileName, CurrentTable.Name)
Dim proc As new Process
proc.File = dlg.FileName
proc.Start
End If
单一只导出图表用以下代码十分清晰:
Dim dlg As new SaveFileDialog
dlg.Filter = "Excel|*.xls;*.xlsx"
Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1)
ws.name = "test"
Dim Chart As WinForm.Chart = Forms("按科室统计").Controls("Chart1")
chart.SaveImage("d:\test.wmf")
ws.Shapes.AddPicture("d:\test.wmf", Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoTrue,0, 0, 100, 80)
app.visible = True
请教老师:
如何将以上合二为一,将清晰的图表插入到导出的多层表头电子表中