Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subreports
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Miscellaneous
Thread ID:
00779750
Message ID:
00779812
Views:
15
Hi Dan,

I am not sure how to set the parameter in the sub-report. The .setparameter command apparently is not recognized. Here is the code in the button.click where I call the report:
LOCAL lcCID, ;
	oRE
* Create an instance of the report engine
oRE = createobj('reportengine')
With oRE
	* Read reports path from Application object
	.cReportFilePath = This.oApplication.cOutputPath
	* Set report engine connection handle
	.ODBChdbc = SQLGetProp( 1 , 'ODBChdbc' )
	lcCID = V_CASE.cID
	If ! .OpenReport('IndictmentJacket.rpt')
		Messagebox(.cErrorMessage,MB_ICONSTOP,'Report Error')
	ELSE
		.SetReportParameter('vp_ccase_cid', lcCID)
****************************
** From Dan Jurden
** get a reference to the sections collection of the main report
*loSections = loReport.Sections
loSections = oRe.oreport.Sections
** Go through each section in the main report...
FOR EACH loSection IN loSections
   ** Get all the objects in this section...
   loReportObjects = loSection.ReportObjects
   ** Go through each object in the reportobjects for this section...
   FOR EACH loReportObject IN loReportObjects
      ** Find the object which is the SubreportObject
      IF loReportObject.Kind = 5 && crSubreportObject
         ** Found a subreport, now get a hold of it
         loSubReportObj = loReportObject
         ** Open the subreport and treat it as any other report
         loSubReport = loSubReportObj.OpenSubreport
         **************************************************
         ** set the parameter in the sub-report here     **
 	     loSubReport.SetReportParameter('vp_ccase_cid', lcCID)
         **************************************************
      ENDIF
   NEXT
NEXT
**************************************************
		.Preview()
	ENDIF
ENDWITH
>Do something like this:
>
>

>** get a reference to the sections collection of the main report
>loSections = loReport.Sections
>
>** Go through each section in the main report...
>FOR EACH loSection IN loSections
> ** Get all the objects in this section...
> loReportObjects = loSection.ReportObjects
>
> ** Go through each object in the reportobjects for this section...
> FOR EACH loReportObject IN loReportObjects
> ** Find the object which is the SubreportObject
> IF loReportObject.Kind = 5 && crSubreportObject
> ** Found a subreport, now get a hold of it
> loSubReportObj = loReportObject
> ** Open the subreport and treat it as any other report
> loSubReport = loSubReportObj.OpenSubreport
>
> **************************************************
> ** set the parameter in the sub-report here **
> **************************************************
>
> ENDIF
>
> NEXT
>
>NEXT
Thanks,

TFISHER
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform