Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Value must be numeric?!?!?!? Post Reply Post New Topic
Author Message
TheLorax
Newbie
Newbie


Joined: 09 May 2007
Online Status: Offline
Posts: 2
Quote TheLorax Replybullet Topic: Value must be numeric?!?!?!?
    Posted: 09 May 2007 at 4:48pm
I am working on a project with another developer and we're using CR for our reports. He created most of the reports and I've recently begun editing them to make changes but I've run into a strange issue. We have a number of formula fields with code such as this:
 
If {command.eItemPaymentType} <> 'CUSTOMER' THEN
    0
else
    IF {command.eReferenceType} = 'SERVICEID' THEN
        (VAL({command.dPrice})*VAL({command.dHours}))*VAL({command.dQuantity})   
    ELSE IF {command.eReferenceType} = 'PARTID' THEN
        VAL({command.dPrice})*VAL({command.dQuantity})
    ELSE IF {command.eReferenceType} = 'KITID' THEN
        VAL({command.dPrice})*VAL({command.dQuantity})
    ELSE IF {command.eReferenceType} = 'LABORID' THEN
        VAL({command.dPrice})*VAL({command.dHours})
 
They work just fine on his machine, but when I go in and try to edit them they all break and it tells me "A string is required here" and highlights the command.dPrice on the 5th line. What I have to do to get the report working is go through and remove anyplace he converted the value to a decimal using the "VAL" function. I have to do this in all of the functions on the report in order to get the report to work. Now, the strange part. When he goes in to edit the same report, it then tells him something to the effect (sorry, he's not here right now for me to get the explicit text) of "value must be numeric".  In a nutshell, my dev environment pulls the values from the DB as decimals while his is pulling them as strings which he has to convert.
 
Can anyone tell me how to change this? Ideally I'd like to just change  a setting so mine works fine with the 'VAL' function calls in the code so I have less work to do. It's silly for me to change them and then have him be forced to change them all back the next time he works on the project. I am sure there is a setting but I can't find it. Any help would be greatly appreciated.
 
BTW: ASP.NET with C# codebehind. Both OS are XP. Vis Studio 2005 using Team Server as the source control. The DB we are working with is MySQL v 5.0.22 and we both have MySQL on our dev machines (aka we're not hitting the same DB)
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 May 2007 at 5:01pm
I'm would be tempted to suggest that you check the table structure and compare your database to his. What might be happening is that there could also be invalid data in the table on one of the databases. So when CR calls the command object then one table might return a stray string value so CR things the field is a string even though all the other rows might have a number in them. You should copy one of the tables to the other box and then do a Check Database to have it requery the database and update the CR internal table structure.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
TheLorax
Newbie
Newbie


Joined: 09 May 2007
Online Status: Offline
Posts: 2
Quote TheLorax Replybullet Posted: 10 May 2007 at 7:27am
Right at this moment it's different but only because I restored a backup from one of our servers. When we first started seeing this behavior we were working off of the same data. When one of us changes the DB structure, we'll do a backup and restore it on the other box. Initally we were working against the same DB server and we still saw the issue there. This leads me to believe it's some sort of CR setting and not the DB.

Edited by TheLorax - 10 May 2007 at 7:28am
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 10 May 2007 at 12:05pm
Yeah, I see what you are saying, but it just doesn't make any sense. I haven't seen this behavior before. Maybe Dell can pitch in here and see if she notices something unusual? Otherwise, I'm still of the opinion that there is something going on with the DB or maybe one of the reports is slightly corrupt? Neither makes a lot of sense, but I don't see how CR could keep changing the data type independently for each computer based on a setting.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.