Hi,
I am using Visual Foxpro 9 with Crystal reports 9
any one could help me to change the data source of my subreport.

I am using a native Xls data type in my crystal report.
I have subreport having another datasource with native Xls data type also and attched to the main report.

I could change the data source of the my main report but
the problem is how to change the data source for the subreport.

I am using this code to create the report from Vfoxpro:
*--------------------
Public CRApplication
Public CRReport
Public CRParm
CRApplication = createobject ("CrystalRuntime.Application")
CRReport = createobject ("CrystalRuntime.Report")
CRReport2 = createobject ("CrystalRuntime.Report")
REPNAME=REPSPATH+'SURVEY.rpt' && report file name for the main report
REPNAME2=REPSPATH+'ssurvey.rpt' && report file name for the subreport

CRReport = CRApplication.OpenReport(REPNAME) &&*!* Open up the report
**-- determin the DATA SOURCE FILE
myLocalDataFile=(DataPATH+'XLFile.xls')

*-- to change the database source for the main report
CRReport.Database.Tables(1).ConnectionProperties.I tem("Database Name") = myLocalDataFile
*---
*-- I need the exact code here to change the data source of the subreport
*---
DO FORM PrevForm

WITH PrevForm.OleControl1
.reportsource = CRReport && *!* Attach the report to the viewer
.ViewReport && Start the Crystal Viewer
ENDWITH

*--------------------
any one could help me !!.
Thank you.