<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Numeric strings and toNumber function in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211916#M2279189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I would try printing out the function&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    IsNumeric({MYVIEW.NumericText})
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;to see if any field comes up as false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2009 14:19:30 GMT</pubDate>
    <dc:creator>ted_ueda</dc:creator>
    <dc:date>2009-10-26T14:19:30Z</dc:date>
    <item>
      <title>Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaq-p/6211913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having problems with Crystal Reports for Eclipse when using some reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem comes with reports that contain toNumeric function with a data that is get from the database, it gives an error that says the string is non-numeric even if it is a numeric string. The formula in the reports looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
numberVar cantidad_dias := ToNumber({MYVIEW.NumericText});
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that using isNumeric condition it works well, but it works well too when using Crystal Reports 2008 without any condition, so I think it should work for Crystal Reports for Eclipse and return error only in the case that the string isn't numeric. Is it a bug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 10:05:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaq-p/6211913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-14T10:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211914#M2279187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would print out the field {MYVIEW.NumericText} delimited by quotes, to see if it's a specific value that the function is tripping over.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 14:17:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211914#M2279187</guid>
      <dc:creator>ted_ueda</dc:creator>
      <dc:date>2009-10-14T14:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211915#M2279188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have printed all the values that are used by the function and are OK, but it still return error when using Crystal Reports for Eclipse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for answering.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 10:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211915#M2279188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T10:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211916#M2279189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I would try printing out the function&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    IsNumeric({MYVIEW.NumericText})
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;to see if any field comes up as false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 14:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211916#M2279189</guid>
      <dc:creator>ted_ueda</dc:creator>
      <dc:date>2009-10-26T14:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211917#M2279190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the returned values are true, so I think that there's no problem with the database values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's strange, because there's no problem if the formula finishes like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;toNumber({MYVIEW.NumericText})&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the error appears if the formula contains something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;numberVar myNum := ToNumber({MYVIEW.NumericText})&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 17:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211917#M2279190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-26T17:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211918#M2279191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a very interesting issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you enable Log4J logging, does that tell anything as to what's causing the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens if you do something really strange to combat the strangeness, like ToNumber(CStr(ToNumber({MYVIEW.NumericText}))), i.e., force Crystal Reports Java to format what it converted to a number to a string to a number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 17:48:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211918#M2279191</guid>
      <dc:creator>ted_ueda</dc:creator>
      <dc:date>2009-10-26T17:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211919#M2279192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It tells that {MYVIEW.NumericText} isn't a numeric string, but I know it is numeric string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried what too you said about ToNumber(CStr(ToNumber({MYVIEW.NumericText}))) and it returns the same error again in the cases that ToNumber({MYVIEW.NumericText}) returned error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2009 08:55:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211919#M2279192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-28T08:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211920#M2279193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really want to know specifically what string is causing that error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about Log4J?  Does that tell you anything?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2009 21:52:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211920#M2279193</guid>
      <dc:creator>ted_ueda</dc:creator>
      <dc:date>2009-10-28T21:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211921#M2279194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Log4J tells:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ERROR com.crystaldecisions.reports.saveddata.saveddata.DataView.a(SourceFile:1095) - Failed to evaluate recurring formulas
com.crystaldecisions.reports.formulas.FormulaException$FormulaProgrammingError: Excepción en la fórmula '{@formula1}' en '{MYVIEW.NumericText}':
La cadena es no numérica.
	at ...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is in spanish, it means: exception in {@formula1} in '{MYVIEW.NumericText}': The string is not numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said earlier, this report works fine at Crystal Reports 2008, I think it should work too with CR4E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 09:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211921#M2279194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T09:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211922#M2279195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if you have end your formula like so....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
.
.
.
numberVar myNum;

myNum := ToNumber({MYVIEW.NumericText});

myNum;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you get the same error? It might just have an issue with declaring and assigning and returning everything all at once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You also mentioned &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the returned values are true, so I think that there's no problem with the database values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's strange, because there's no problem if the formula finishes like this:&lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
toNumber({MYVIEW.NumericText})
&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the error appears if the formula contains something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
numberVar myNum := ToNumber({MYVIEW.NumericText})
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im sure it wont make a difference but you got a lower case toNumber in the working and an uppercase ToNumber in the issue.&lt;/P&gt;&lt;P&gt;But I still think give my initial test a try.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Darren Jackson on Oct 29, 2009 3:02 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Know this is not a solution to the problem from a CR4E point of view but&lt;/P&gt;&lt;P&gt;If you cant solve the problem in the report, is converting it to a number within the View an option?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 13:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211922#M2279195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T13:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211923#M2279196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I can't duplicate the behavior, I can't help you.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I really do want to duplicate the behavior, and help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something is triggering this, and I don't see the trigger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ted Ueda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 13:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211923#M2279196</guid>
      <dc:creator>ted_ueda</dc:creator>
      <dc:date>2009-10-29T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211924#M2279197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get the same error declaring, assigning and returning everything all in once, or doing it in three steps. I also have tried with uppercase and lower case and once again the same error appears when doing the exportation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that it happens at the time of assignation, because only appears when using the assignation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to do the assignation to a string with CStr(ToNumber({MYVIEW.NumericText})), based on Ted's previous advice, always the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;stringVar myString := {MYVIEW.NumericText};
numberVar myNum := ToNumber(myString);
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:46:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211924#M2279197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T14:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211925#M2279198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my previous post I said that the error happens at assignation time, now, I have noticed that isn't true, the error appears if in the formula is an assignation, but the error happens at ToNumber function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, as I have said, the following formula is correct:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ToNumber({MYVIEW.NumericText});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the following formulas return error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;stringVar str := "123";
ToNumber({MYVIEW.NumericText});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ToNumber({MYVIEW.NumericText});
stringVar str := "123";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;returning {MYVIEW.NumericText} is non-numeric string in both cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2009 16:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211925#M2279198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-04T16:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric strings and toNumber function</title>
      <link>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211926#M2279199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue was caused by the fact that the database contained null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the formula as follow solved the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ({VIEW.FIELD}  &amp;amp;lt; &amp;amp;gt;  "") then&lt;/P&gt;&lt;P&gt;numbervar var := tonumber({VIEW.FIELD})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flavio Ceccarelli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2009 16:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/numeric-strings-and-tonumber-function/qaa-p/6211926#M2279199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-10T16:47:08Z</dc:date>
    </item>
  </channel>
</rss>

