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 RETURNMind you this was working at one point. I don't know what went wrong. I'm really
>>This.oleCrystalViewer.ViewReport()
>>
>>