on ‎2009 Oct 14 11:05 AM
Hello,
I'm having problems with Crystal Reports for Eclipse when using some reports.
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:
...
numberVar cantidad_dias := ToNumber({MYVIEW.NumericText});
...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?
Thanks
Request clarification before answering.
The Log4J tells:
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 ...It is in spanish, it means: exception in {@formula1} in '{MYVIEW.NumericText}': The string is not numeric.
As I said earlier, this report works fine at Crystal Reports 2008, I think it should work too with CR4E.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What happens if you have end your formula like so....
.
.
.
numberVar myNum;
myNum := ToNumber({MYVIEW.NumericText});
myNum;
Do you get the same error? It might just have an issue with declaring and assigning and returning everything all at once.
You also mentioned
All the returned values are true, so I think that there's no problem with the database values.
It's strange, because there's no problem if the formula finishes like this:
toNumber({MYVIEW.NumericText})but the error appears if the formula contains something like this:
numberVar myNum := ToNumber({MYVIEW.NumericText})
Im sure it wont make a difference but you got a lower case toNumber in the working and an uppercase ToNumber in the issue.
But I still think give my initial test a try.
Thanks
Darren
Edited by: Darren Jackson on Oct 29, 2009 3:02 PM
Know this is not a solution to the problem from a CR4E point of view but
If you cant solve the problem in the report, is converting it to a number within the View an option?
Hi all,
The issue was caused by the fact that the database contained null values.
Changing the formula as follow solved the issue
if ({VIEW.FIELD} < > "") then
numbervar var := tonumber({VIEW.FIELD})
Kind Regards,
Flavio Ceccarelli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
For example, as I have said, the following formula is correct:
ToNumber({MYVIEW.NumericText});but the following formulas return error:
stringVar str := "123";
ToNumber({MYVIEW.NumericText});or
ToNumber({MYVIEW.NumericText});
stringVar str := "123";returning {MYVIEW.NumericText} is non-numeric string in both cases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
I think that it happens at the time of assignation, because only appears when using the assignation.
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.
And also with:
stringVar myString := {MYVIEW.NumericText};
numberVar myNum := ToNumber(myString);
...Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It tells that {MYVIEW.NumericText} isn't a numeric string, but I know it is numeric string.
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.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All the returned values are true, so I think that there's no problem with the database values.
It's strange, because there's no problem if the formula finishes like this:
toNumber({MYVIEW.NumericText})but the error appears if the formula contains something like this:
numberVar myNum := ToNumber({MYVIEW.NumericText})Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's a very interesting issue.
If you enable Log4J logging, does that tell anything as to what's causing the issue?
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?
Sincerely,
Ted Ueda
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.
Thanks for answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.