Okay, this is making me crazy.
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 is delivering applications solutions at at top companies
around the world in government. Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294232
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4