Gary,
Sorry to take so long to reply. I did not have good web access from Whilfest, so I didn't get on the UT.
Have you tried just passing the value without macro expansion?
oparm.SetCurrentValue(m.masterloan)
>Craig,
>
>Thank you for the article "Integrating Crystal with VFP".
>The following code is supposed to view the report with passing a parameter.
>The report has (1) parameter field called loanid and is a numeric field.
>This field is used within the query to print this report for one loan number.
>The loan number is stored in m.masterloan.
>when the application runs
>it does not seem to build the array for the parameter field**ocparm=CRReport.ParameterFields()**
>when it gets to oparm.SetCurrentValue(&m.masterloan) then I get function not found.
>
>any help would be appreciated
>
>Thanks
>Gary
>
>CRApplication = createobject("CrystalRuntime.Application")
>CRReport = CRApplication.openreport(&thisreport)
>ocparm=CRReport.ParameterFields()
>oparm=ocparm.Item(1)
>m.masterloan=int(m.masterloan)
>oparm.SetCurrentValue(&m.masterloan)
>this.rptviewer.reportsource=CRReport
>this.rptviewer.enableexportbutton=.t.
>this.rptviewer.enablepopupmenu=.t.
>this.rptviewer.enablezoomcontrol=.t.
>this.rptviewer.enablesearchexpertbutton=.t.
>this.rptviewer.viewreport
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer