>Hi to all,
>
>Can I print the Chart created in MSChart control?
>
>Thanks in advance.
>
>Noel
Noel,
MsChart control doesn't have a method to print or save. However you can still do it in at least 3 ways :
1) Call MSChart.EditCopy and paste this to somewhere else. ie: You could create a cursor with a general field and paste special there (DIB). A general field could be printed via report.
2) On MSDN online check Q97193 WinCap.exe has DIBApi32.dll which you can use to either save or print clipboard content that you saved with MSChart.Editcopy.
3)
Last and easiest IMHO is to use George Tasker's 'Obj2BMP' which you could find in download section. Utility is great (thanks George) in few lines you could save to a .bmp file. If utility is in public domain here is the sample code to save to a bmp :
set library to home()+'foxtools.fll' additive
lnBPP = 24
oBmp = newOBJECT("BMPMaker","BmpMaker.prg")
oBmp.cFileName = 'mschartsave.bmp'
with ThisForm.MsChart
oBmp.MakeBitmap(_WhToHwnd(_WOnTop()), lnBPP, ;
.top+sysmetric(9)+sysmetric(4), .left+sysmetric(3), .height, .width)
endwith
You could print this file in many different ways including getting into a temp cursor general field.
Cetin