Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Report
Message
From
30/01/2000 15:07:38
Walter Meester
HoogkarspelNetherlands
 
 
To
30/01/2000 13:19:19
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00324615
Message ID:
00324845
Views:
43
Roni,

First of all it is best to use the automation server approach instead of the Crystal REports ActiveX control. This one provides more power and flexibility.

Within the automation server approach you can use the following code to pass the parameters trough:

NOTE: this example works for CR 6.0 and up, I Don't know i it works for previous versions.
oEngineObject=CREATEOBJECT("Crystal.CRPE.Application")

oReport=oEngineobject.openreport(cReportname)
oReport.ParameterPromptingEnabled=.F.

* Set optional parameterfields
* Each parameterfield has a name. If this name match an existing VFP variable
* Then pass the value of this variable to the parameterfield of the report.
* note that the VFP variables used for these paramaters must be declared either Public or 
* Private in the calling method.

WITH oReport.ParameterFields
	FOR nT= 1 TO .Count
		cName=.Item(nT).ParameterFieldName
		IF TYPE(cName) # "U"
			.item(nT).SetCurrentValue(EVAL(cName))
		ENDIF
	ENDFOR
ENDWITH
For more documentation about the automation server approach see help.

Walter,

>Hallo Walter!
>Can you explain how to send parameters from VFP.
>If you can with example.
Previous
Reply
Map
View

Click here to load this message in the networking platform