Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page Count Question
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
01186301
Message ID:
01194799
Views:
6
Craig,

I have narrowed down the behavior to the line of code which seems to be the
culprit. If I comment out the line, everything is fine, except I get prompted
to enter parameter info.

If I allow the line, the report displays without prompting me, but I cannot get
the other controls on the form to work via the keyboard.


We accept parameter info from dialogs, then pass them as an array to this method.

The array looks similar to:
Param		Value
----------------------
@Language	'ENG'
@Key		123
@State		'CA'




LPARAMETERS aParameters, oCRReport AS CRAXDRT.Report

** Define variables
LOCAL aParameters[1] AS Variant
LOCAL lFound AS Boolean
LOCAL nParam AS Integer
LOCAL oErr AS Exception
LOCAL oParameter AS Object
LOCAL oParams AS Collection

WITH ThisForm

	** Get a reference to the parameter collection on the report
	oParams = oCRReport.ParameterFields()

	** Loop once for each parameter
	FOR nParam = 1 TO ALEN(aParameters, 1)
	
		** Turn on the found flag
		lFound = .T.

		TRY
			** Get the parameter pbject
			oParameter = oParams.GetItemByName(aParameters(nParam, 1))
			
		CATCH TO oErr

			** If here, the parameter was not found
			lFound = .F.

		ENDTRY

		** If the parameter was found...
		IF lFound
		
			** If the parameter is a logical True...
			IF VARTYPE(aParameters[nParam, 2]) = 'L' AND aParameters[nParam, 2] = .T.
			
				** Reset the parametet to its default value
				oParameter.SetCurrentValue(oParam.DefaultValue)
				
			ELSE
			
&& THIS LINE CAUSES THE BEHAVIOR
				** Set the parameter to the array's value
				oParameter.SetCurrentValue(aParameters[nParam,2])	
				
			ENDIF
			
		ENDIF
		
	ENDFOR

ENDWITH

RETURN
Mind you this was working at one point. I don't know what went wrong. I'm really
stuck on this. I have no idea why this is happening. I could use any insight you
can provide.

Thanks



>I'll have to play a bit with this, but can't get to it until tonight.
>
>
>>Craig,
>>
>>Everything seems to be fine with the report - right up until I
>>call
>>
>>
>>This.oleCrystalViewer.ViewReport()
>>
>>
>>When I call it, the report displays fine, but none of the
>>textboxes I have on the same form, like a Search Text field,
>>are working. When I enter the fields and start typing, nothing
>>happens. I don't see any text.
>>
>>Neither the KeyPress or InteractiveChange events fire, nor are the
>>properties the fields are bound to being changed.
>>
>>If I do not call ViewReport(), everything works fine, except that
>>I don't see the report.
>>
>>Any ideas?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform