bhavesh55
asked on
Compare variable's value in crystal......
I tried to wrote same formula in 2 different ways but unfortunately it didn't run.
It gives me below mentioned error when i try to preview my report.
1)Error: Numeric Overflow.
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If chr({table_site.child_site 2site}) = X then
{table_site.name}
Else
""
Else
""
2)Error:The String is non-numeric.
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If {table_site.child_site2sit e} = ToNumber(X) then
{table_site.name}
Else
""
Else
""
Let me know as soon as you can.
Thanks for your time in advance.
Thanks,
bhavesh55
It gives me below mentioned error when i try to preview my report.
1)Error: Numeric Overflow.
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If chr({table_site.child_site
{table_site.name}
Else
""
Else
""
2)Error:The String is non-numeric.
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If {table_site.child_site2sit
{table_site.name}
Else
""
Else
""
Let me know as soon as you can.
Thanks for your time in advance.
Thanks,
bhavesh55
The `chr` function returns a string containing the character associated with the specified character code.
and you you have to pass a numerique value to that function.
If you want to convert to Character, you should use the str() function.
Hope that help.
and you you have to pass a numerique value to that function.
If you want to convert to Character, you should use the str() function.
Hope that help.
behive keeps asking this same question over and over?
Looks like Pascal/Delphi to me based on the := portion
ASKER
All Experts
I am talking about "Crystal Report ver. 8.0".
Please let me know as soon as you can.
Thanks for your time in advance.
Thanks,
bhavesh55
I am talking about "Crystal Report ver. 8.0".
Please let me know as soon as you can.
Thanks for your time in advance.
Thanks,
bhavesh55
ASKER
Fields in Sql-server Database:
x_site_group , name --> char
objid,child_site2site --> int
table_site --> table name
I put above mentioned formula in crystal report's formula editor and i unable to run it successfully.
Please try and let me know i can i fix that.
Thanks,
bhavesh55
x_site_group , name --> char
objid,child_site2site --> int
table_site --> table name
I put above mentioned formula in crystal report's formula editor and i unable to run it successfully.
Please try and let me know i can i fix that.
Thanks,
bhavesh55
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
StingRaY
I wrote below mention code:StringVar X;
If {table_site.x_site_group} = "Bldg" then X := ToText({table_site.objid}, 0)
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s ite2site}, 0) = X then {table_site.name}
Else ""Else ""
It shows me value of "{table_site.objid}".Actua lly in "Else if" part i wrote
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays me value of "objid".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
I wrote below mention code:StringVar X;
If {table_site.x_site_group} = "Bldg" then X := ToText({table_site.objid},
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s
Else ""Else ""
It shows me value of "{table_site.objid}".Actua
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays me value of "objid".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
ASKER
StingRaY
I wrote below mention code:StringVar X;
If {table_site.x_site_group} = "Bldg" then X := ToText({table_site.objid}, 0)
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s ite2site}, 0) = X then {table_site.name}
Else ""Else ""
It shows me value of "{table_site.objid}".Actua lly in "Else if" part i wrote
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays most of the time value of "objid" and sometimes "name".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
I wrote below mention code:StringVar X;
If {table_site.x_site_group} = "Bldg" then X := ToText({table_site.objid},
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s
Else ""Else ""
It shows me value of "{table_site.objid}".Actua
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays most of the time value of "objid" and sometimes "name".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
ASKER
StingRaY
Above ones is not properly shown so i resubmit the same one.
I wrote below mention code:
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := ToText({table_site.objid}, 0)
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s ite2site}, 0) = X then
{table_site.name}
Else
""
Else ""
It shows me value of "{table_site.objid}".Actua lly in "Else if" part i wrote
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays most of the time value of "objid" and sometimes "name".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
Above ones is not properly shown so i resubmit the same one.
I wrote below mention code:
StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := ToText({table_site.objid},
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s
{table_site.name}
Else
""
Else ""
It shows me value of "{table_site.objid}".Actua
"{table_site.name}".Means if condition is satisfied than it should display
that value.Instead of that it displays most of the time value of "objid" and sometimes "name".
Let me know how do i resolve this problem.Or whats wrong with it ?
Thanks for your time in advance.I am eagerly waiting for your reply.
Thanks,
bhavesh55
bhavesh55
StringVar X := ToText({table_site.objid}, 0);
If {table_site.x_site_group} = "Bldg" then
X
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s ite2site}, 0) = X then
{table_site.name}
Else
""
Else
"";
At the first, I assign value of "objid" to X.
if x_site_group is "Bldg", yes it will return X.
if not...but is "Tenant", yes check if value is satisfied then return Site Name
unsatisfied the return "" (zero-length string)
other x_site_group will return "" (zero-length string)
Sorry, English language is not my native language, mine is Thai. I will apologise you if I mis-understand your question.
Happy with programming ^_^
StringVar X := ToText({table_site.objid},
If {table_site.x_site_group} = "Bldg" then
X
Else If {table_site.x_site_group} = "Tenant" then
If ToText({table_site.child_s
{table_site.name}
Else
""
Else
"";
At the first, I assign value of "objid" to X.
if x_site_group is "Bldg", yes it will return X.
if not...but is "Tenant", yes check if value is satisfied then return Site Name
unsatisfied the return "" (zero-length string)
other x_site_group will return "" (zero-length string)
Sorry, English language is not my native language, mine is Thai. I will apologise you if I mis-understand your question.
Happy with programming ^_^
ASKER
You didn't understand my question properly.
Anyway, i will give you points for your help.
Thanks,
bhavesh55
Anyway, i will give you points for your help.
Thanks,
bhavesh55
ASKER
StingRaY
You didn't understand my question properly.
Anyway, i will give you points for your help.
Thanks,
bhavesh55
You didn't understand my question properly.
Anyway, i will give you points for your help.
Thanks,
bhavesh55
bhavesh55
Thank you for given score.
Email me with more information about your question.
This will not impact the score...
....
StingRaY
Thank you for given score.
Email me with more information about your question.
This will not impact the score...
....
StingRaY
could you see what's in X after the line
X := chr({table_site.objid})
maybe in a message or something?