>>>I am thinking about using Crystal Reports in my VFP application. Has anyone had any success using Crystal Reports or am I better off sticking with the Office Automation?
>>>
>>>Lawrence
>>We sucessfully integrated Crystal Reports in a VFP application. I highly recommend you Craig's article on this topic:
http://www.craigberntson.com/Articles/kb010.htm>
>
>Hi Hector,
>In your application do you set the printer destination for a Crystal report? There is a SelectPrinter() method but it requires the printer driver (which in VB is not a problem at all).
The way we did it is like this. We launch Crystal, then we load the report that we want. The "report" object has a PrinterSetup() method. This method receives a "windows handle" (hWnd). If you are using VFP7, all forms have now a property called thisform.hWnd that you can pass as a parameter. More or less, like in the following code:
* Load crystal reports engine.
thisform.oCrystalReports = CREATEOBJECT( .cCrystalReportsClass )
* Load an actual report.
thisform.oReport = thisform.ocrystalreports.OpenReport( thisform.cReportFile )
* here you will add code to launch the viewer. *
* Launch the printer setup dialog.
thisform.oREport.PrinterSetup( thisform.HWnd )
If you are not using VFP7, then you will need to find out a way to get the windows handle of your VFP form (the hWnd.) I am not sure how you can do that, perhaps with an API call or via FoxTools.fll.
Hector Correa