Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: a string is required here. Post Reply Post New Topic
Author Message
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Topic: a string is required here.
    Posted: 11 Aug 2012 at 4:03am
hi all
I Use This Codes in my Report


IF Right({rptProductAction2.Quanty},2)='00' THEN
Round({rptProductAction2.Quanty})

but i see an error( a string is required here.)
in this line:
Right({rptProductAction2.Quanty},2)

how solve it
please help me
thanks
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 12 Aug 2012 at 8:29am
Not sure if trolling or not, but here goes,

I assume your .quanty field is a number ,as you are trying to round it.

Its because your product.quanty field is a number field/value. the RIGHT command is for text fields/values.

not sure though, why you want to round a number if it ends in 00. surely this is already rounded?


o_O

Regards,

Michael Jones
IP IP Logged
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Posted: 13 Aug 2012 at 3:11am
thnks dear for your help
For Example:
I Have 2 values in this field...
my values Is:
95080.58
90830.00
now I want to see this
95080.58
90830

how to solve it
thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Aug 2012 at 3:16am
You would have to convert both to strings to get that format - Crystal will always format numbers based on the number of decimals you set for the field - it's not variable.
 
So, you would have to do something like this:
 
If Right(ToText({rptProductAction2.Quanty}, 2) = '00' then
  ToText({rptProductAction2.Quanty}, 0, '')
else ToText({rptProductAction2.Quanty}, 2, '')
 
-Dell
IP IP Logged
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Posted: 13 Aug 2012 at 4:26am
thanks dear for your help
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.015 seconds.