Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Please help: modifying output of fields Post Reply Post New Topic
Author Message
mike.o
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 11
Quote mike.o Replybullet Topic: Please help: modifying output of fields
     Posted: 26 Jul 2010 at 11:04am
How do you modify the information drawn from the field? For example, I have a PhoneNumber field and I only want it to print out the last four digits?
Thanks
M
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 11:48am
right(field,4)
IP IP Logged
mike.o
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 11
Quote mike.o Replybullet Posted: 26 Jul 2010 at 11:56am
Thanks for reply
where do i put that? I don't even know how to get to the code part, maybe that's what i really need to know and in addition what language?

also does crystal allow for graphical drawing. for example, i want to seperate sections by putting vertical/horizontal bars. does crystal have that feature or do i have to import jpegs and put them in boxes?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 12:06pm

Righ click on the Formula Fields option and select NEw

Call it whatever (PhoneLast4)
write your formula here
Right({table.phone#Field},4)
Place this formula field on your report canvas the same way you would any db field.
 
Crystal has a pencil and box option to draw lines or boxes
IP IP Logged
mike.o
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 11
Quote mike.o Replybullet Posted: 27 Jul 2010 at 8:45am
o wow thanks a lot!
where can i learn about the formula language?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2010 at 9:02am
hmmm,
crystal Help is actually a pretty good resource for this. You can use Basic or Crystal Syntax (you can flip each formula to use either one).
 
Of course Brian's book is a great resource.  Thumbs%20Up
 
I think it is also a learn as you go sort of thing.
I would read as many posts as you can, look at all the formulas being written, deconstruct it and use crystal help to search on keywords so you can understand it and then reuse it in your own work.
IP IP Logged
mike.o
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 11
Quote mike.o Replybullet Posted: 29 Jul 2010 at 10:40am
where does table.phone#Field come from?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jul 2010 at 10:51am
It was just a place holder int eh formula for your Database field that stores the phone number data.
You should find those in the Field Explorer in the Database Fields portion.
IP IP Logged
mike.o
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 11
Quote mike.o Replybullet Posted: 29 Jul 2010 at 12:55pm
Thanks for the reply.
Hmm I still get an error. I have a field called {PhoneNumber}
so...I wrote
Right({PhoneNumber},4)
or is my syntax still off?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jul 2010 at 3:17pm

drag and drop the field from the list into the formula editor to make sure you do not need a table name in front of the field name (like {customers.PhoneNumber}).

Also the data type impacts how to do it. I assumed it was a string or text field
It could be numeric which does not allow for the same process. If it is a numerif field type we can convert it to a string to accomplish it like so...
Right(totext({PhoneNumber},0,''),4)
 
 
If neither of these work what exactly is the error you are getting?


Edited by DBlank - 29 Jul 2010 at 3:17pm
IP IP Logged
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