Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal Repot RDC and VFP
Message
De
06/04/2002 10:53:17
 
 
À
06/04/2002 10:00:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00641797
Message ID:
00641802
Vues:
19
>Currently I am developing an application using VFP and crystal reports using RDC. I do not know how to pass parameters from VFP using RDC to crystal report. Can someone help me on this.
>Thanks & Best Regards
>Rajeev

After you open the report, and have your report object, the report object has a ParameterFields collection. Each parameter you put in your report will be in this collection. If you only have one parameter you can just use the first index, if you have more than one you have to determine its index.

Once you have a reference to the parameter object you can use the AddCurrentValue() method to set its value(s).

Here are to methods from my RDC wrapper class that are used to set a parameter, I just pass the parameter name (or index if you know it) and value I want to set it to.
*function setreportparameter
lparameters uParameter, uValueToSet

Local nIndex

If vartype(uParameter) == 'C'
	nIndex = this.GetParameterIndex( uParameter )
Else
	nIndex = uParameter
EndIf

With This.oReport.ParameterFields.Item(nIndex)

	.ClearCurrentValueAndRange()
	.AddCurrentValue( uValueToSet )
	
EndWith

*function getparameterindex
Lparam cName

Local ;
	x,;
	nCount,;
	lFound

With This.oReport.ParameterFields

	nCount = .Count

	For x = 1 to nCount

		If upper(.Item(x).Name) = '{?'+upper(cName)+'}'
			lFound = .t.
			Exit
		Endif

	Next x

	If ! lFound
		x = null
	Endif

	Return x

Endwith
HTH,
BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform