Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: numeric to string conversion problem Post Reply Post New Topic
Author Message
flintwood
Newbie
Newbie
Avatar

Joined: 31 Jul 2010
Online Status: Offline
Posts: 16
Quote flintwood Replybullet Topic: numeric to string conversion problem
    Posted: 24 Aug 2010 at 3:53am
I have a simple parameter that coverts a numeric parameter to a string and used the formula below
 
{paramater} = totext({numeric.field})
 
also tried
 
{paramater} = cstr({numeric.field})
 
and changed the paratemeter type to string in the edit parameter box. The problem is the input is a range, so I set the range to true and when i enter the numeric vallues to get a summary value i get a wrong result. Is there any other way to go about it because I have also choose "all", so i used "all" as the default value but again the sum result is coming out wrong. any ideas anybody? Thanks
FW
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Aug 2010 at 4:04am
ok you have a parameter that has a the word all, or a range like 1-10, or just a number, like 5 in it?  And you need to determine if the value in the table matches the parameter?
 
if this is the case, I would try something like:
local booleanvar keep := true;
local numbervar start;
local numbervar finish;
 
if {?parameter} <> 'ALL' then(
  if instr({?parameter}, '-') > 0 then(
    start := val(mid({?parameter}, 1, instr({?parameter}, '-'));
    finish := val(mid({?parameter},instr({?parameter}, '-')+1);
    if {numeric.field} > finish or {numeric.field} < start then keep := false;
 
  )
  else(
    if val({?parameter}) <> {numeric.field} then
      keep := false
  )
);
 
keep
 
 
I think that will work...might have minor syntax issues with ;
 
HTH
IP IP Logged
flintwood
Newbie
Newbie
Avatar

Joined: 31 Jul 2010
Online Status: Offline
Posts: 16
Quote flintwood Replybullet Posted: 27 Aug 2010 at 6:31am
Thanks a lot friend !...i will try it out.
FW
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.