Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: adding 0 to end of number Post Reply Post New Topic
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: adding 0 to end of number
    Posted: 03 Jan 2013 at 7:16am
I have a report that has a line number table in it.  The line numbers print "1" I need it to print with a 0 added to end "10".  I tried using
ToText({line.number}, "0") but I get a message that says to many arguments have been given this function?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Jan 2013 at 7:51am

{line.number} *10

or
 
ToText({line.number},0,"") & "0"


Edited by DBlank - 03 Jan 2013 at 7:52am
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 03 Jan 2013 at 9:30am
I am so confused! I entered the formula that you gave me and I get an error that says: A number, or currency amount is required here.  But when I put the table in the report as is I get a number, the one that is listed a the line number 1 ect...  ????
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Jan 2013 at 9:39am
for your line number field what is the data type?
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 03 Jan 2013 at 10:11am

A string.  I tried to convert the string to a number but did not work.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Jan 2013 at 10:22am
just use
{line.number} & "0"
 
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 03 Jan 2013 at 10:36am
I cannot believe it was that easy!! I am not sure I fully understand why this worked but ({line.number},"0") didn't.  Thanks so much!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Jan 2013 at 10:43am
you can concantenate strings with "&" or "+" between the values
 
you were trying to convert a string to a string which does not really work.
the totext(field) function also has optional arguments (where you placed the "0") that impact how it works.
you were using the string formating option.


Edited by DBlank - 03 Jan 2013 at 10:44am
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 03 Jan 2013 at 10:49am
Thank you for teaching me something new!
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.000 seconds.