I didn't check your code out, but I just read in the CF8 release notes
something that rang a bell with the error you report. In release note
#69987:

You must put quotation marks (") around string input parameter values.
The quotes are required because the dialog allows any types of values
like, such as float, date-time, integer, or object. so ColdFusion does
not automatically surround the value in quotation marks.

Cheers,
Kris

> I have a report that has worked just fine in CFMX 7. Now that we are starting 
> to migrate to CFMX 8, I'm getting a very strange error.
>
> The code and the .cfr have not changed. Running against the same code and 
> data it works under 7 but not 8.
>
> The specific error I am getting is:
>
> Invalid ColdFusion expression in report.
> If the expression is a string, ensure that it is within quotes. Error: 
> query.PRIOR_PS_NUM is not a valid ColdFusion expression.
>
>
> (Sometimes it is another column: query.PRIORITY_SCORE_NUM)
>
>
> The expression I'm using these columns in originally looked like this:
>
> "("&iif(query.PRIOR_PS_NUM is "",'""','LSNumberFormat(query.PRIOR_PS_NUM, 
> ",_")')&"/"&iif(query.PRIOR_PERCENTILE_NUM is 
> "",'""','LSNumberFormat(query.PRIOR_PERCENTILE_NUM, "_._")')&")"
>
>
> I thought perhaps the iif()'s were suboptimal so I built a couple of 
> functions in the report and changed the expression to "(" & 
> report.formatPriorityScore(query.PRIOR_PS_NUM) & "/" & 
> report.formatPercentile(query.PRIOR_PERCENTILE_NUM) & ")"
>
> My functions look like this:
>
> <cffunction name="formatpriorityscore">
> <cfargument name="priorityScoreValue" required="yes" type="string">
> <cfset var returnString="">
> <cfif len(trim(priorityScoreValue)) GT 0>
>         <cfset returnString=LSNumberFormat(priorityScoreValue, ",_")>
> </cfif>
> <cfreturn returnString>
> </cffunction>
>
> <cffunction name="formatpercentile">
> <cfargument name="percentileValue" required="yes" type="string">
> <cfset var returnString="">
> <cfif len(trim(percentileValue)) GT 0>
>         <cfset returnString=LSNumberFormat(percentileValue, "_._")>
> </cfif>
> <cfreturn returnString>
> </cffunction>
>
>
> However, I'm still getting the same error.
>
>
> I saw a thread on the Adobe forums ( 
> http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=20&threadid=1307965&enterthread=y
>  ) where someone expressed they were having trouble with null values, 
> although the circumstances were slightly different. However, since my query 
> will sometimes return null I thought it was worth a shot.
>
> So, I changed my query to explicitly return an empty string instead of null 
> (Oracle NVL() function).
>
> Still the same error.
>
>
> I'm at the end of my rope. If I can't fix this, our CFMX 8 upgrade is dead in 
> the water, as this is affecting reports from our most important application. 
> (There's also another weird error I'm getting with CFDOCUMENT, but that's not 
> related to this.)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294264
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

Reply via email to