Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: 2 questions Post Reply Post New Topic
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Topic: 2 questions
    Posted: 01 Apr 2016 at 4:49am
Hi, I am trying to write a quick report and i am having problems with 2 things.

First of all, If i want to print a different value depending on a field, how would i do that? for example if trans_type = 18 then i want it to print a D. If trans_type= 31 then i want it to print a V
I know i have done this before, but can't seem to remember how i did it..
the formula i have only prints the type V and i can't figure out why.
this is what i have for formula:

IF {V_GL_DETAIL.TRAN_TYPE}='18' THEN "D"; IF {V_GL_DETAIL.TRAN_TYPE}='31' then "V"


the other issue i'm having is i have a numeric field and they want it to print like this: $3463.00 should print as 346300   no commas, decimal positions. i have tried formatting with no luck.

IP IP Logged
Valert16
Groupie
Groupie
Avatar

Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Quote Valert16 Replybullet Posted: 01 Apr 2016 at 5:18am
First: Try This
IF {V_GL_DETAIL.TRAN_TYPE}='18' THEN "D"
ELSE IF {V_GL_DETAIL.TRAN_TYPE}='31' then "V"

Second:
Right click numeric field --> Select Number Tab --> Uncheck Currency Symbol (if you don't want it) and Choose $-1123 as style. This will show a currency field without commas and zero decimal positions. Is this what you want?
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 01 Apr 2016 at 5:46am
i have figured out the first issue... now just trying to get a number 3463.00 to 346300
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 01 Apr 2016 at 6:10am
thanks, i did try that. but i need the decimal positions to show... i just need to eliminate the decimal point. so $3463.20 should be displayed as 346320 I need it this way because i need to download it into a csv file
IP IP Logged
Valert16
Groupie
Groupie
Avatar

Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Quote Valert16 Replybullet Posted: 01 Apr 2016 at 6:48am
I suppose your field is of currency type. To get the format you want try this:
Right click numeric field --> Common Tab --> Double click the conditional formula icon next "Display String:" , use this code
ToText(CDbl({Table.Field}), 2, "", "")
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Apr 2016 at 4:18am
What happened to just multiplying by 100?  If you need to convert the number to currency or a number first.  That should be easy.
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.016 seconds.