* Open the RDC engine oEngineObject = CREATEOBJECT("CrystalRuntime.application") * Open the report oReport=oEngineobject.openreport(cReportname) * be sure your Variable (parameter) names in crystal are the same as used in VFP * then you can use the following code to pass the paramters to CR WITH oReport.ParameterFields FOR nT= 1 TO .Count cName=.Item(nT).ParameterFieldName IF TYPE(cName) # "U" .item(nT).SetCurrentValue(EVAL(cName)) ENDIF ENDFOR ENDWITH * Change the location of the data into location of your created FOX2X (temp) table. * This sample code assumes that the array aDBFFiels contains the locations of * the FOX2X tables used in your report in the following manner * aDBFFiles[nI, nI] * - The first column contains the location of the DBF file. If there are more * than one DBF files to be used within your report, you can add new rows for * each DBF file you need. * - The second column is used when you want to change table locations in * subreports. Therefore the second column contains the name of the subreport. * * Be sure that the files for the main report are at the beginning of the array, * and those of subreports grouped at the end. * The physical order in which the tables are added in Crystal Reports determines * the order in which they should appear in this array. IF TYPE("aDBFfiles(1)")="C" nI=1 FOR nT = 1 TO ALEN(aDbffiles,1) IF ALEN(aDBFfiles,2)>1 AND !EMPTY(aDBFfiles[nT,2]) oReport=THIS.Report.Opensubreport(aDBFfiles[nT,2]) nI=1 ENDIF IF !EMPTY(aDbffiles(nT,1)) oReport.Database.Tables.item[nI].location = aDbffiles(nT,1) ENDIF nI=nI+1 ENDFOR ENDIF * O.K. Now your reports is set up. You can print it with: oReport.Printout(lPromptUser) * When Previewing you must include the smartviewer activeX control. * Make it the same size as your previewing form. * Use the following code to preview the report in the activeX control THISFORM.CrViewer.ReportSource = oReport THISFORM.CrViewer.Viewreport()These are the basics to handle reports in the RDC manner within VFP. For further documentation read the Developer.hlp, somewhere in your crystal reports directory.