I have a crystal report that operates within a VFP apllication.
This report has a parameter field and within a sub_report there is another parameter field.
I have used the following code to set the value in the main report but do not know how to set the value for the parameter field within the sub report.
Any help wil be appreciated!
thisreport= '"f:\apps\in-house apps\eomaccounting\REPORTS\'+trim(m.rptctrl)+'"'
CRApplication = createobject("CrystalRuntime.Application")
CRReport = createobject("CrystalRuntime.Report")
CRReport = CRApplication.openreport(&thisreport)
ocparm=CRReport.ParameterFields()
oparm=ocparm.Item(1)
oparm.SetCurrentValue(rpt_dt)
this.parent.rptviewer.reportsource=CRReport
this.parent.rptviewer.enableexportbutton=.t.
this.parent.rptviewer.enablepopupmenu=.t.
this.parent.rptviewer.enablezoomcontrol=.t.
this.parent.rptviewer.enablesearchexpertbutton=.t.
this.parent.rptviewer.viewreport
this.parent.rptviewer.setfocus()
Thanks in advance
God Bless America