Is the subreport linked or unlinked?
>Craig,
>I'm stillhaving a problem with my code to run a report with parameters and includes a subreport with parameters.
>
>The following is my code.
>
>ocr = createobjec("CrystalRuntime.application")
>orpt = ocr.openreport("f:\apps\in-house apps\eomaccounting\REPORTS\Other Reports\Loan Sale Trust Posting.rpt")
>if orpt.hassaveddata
> orpt.discardsaveddata()
>endif
>ocparm=orpt.ParameterFields()
>oparm=ocparm.Item(1)
>oparm.SetCurrentValue(loan_sell_date)
>oparm=ocparm.Item(2)
>oparm.SetCurrentValue(wkinv_cd)
>oSubRpt = oRpt.OpenSubReport("F:\Apps\In-House Apps\eomaccounting\REPORTS\Other Reports\trstsalesum.rpt") (problem line)
>IF oSubRpt.HasSavedData
> oSubRpt.DiscardSavedData()
>ENDIF
>oSubCParm = oSubRpt.ParameterFields()
>oSubParm = oSubCParm.Item(1)
>oSubParm.SetCurrentValue(loan_sell_date)
>oSubParm = oSubCParm.Item(2)
>oSubParm.SetCurrentValue(wkinv_cd)
>orpt.printout()
> I am getting this error on the above designated code line.
>"Invalid Subreport Name"
>
>This subreport is located in the report footer of the main report and is located at the path stated above. In the main report is refers to the subreport as "trstsalesum"
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer