Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Hiding Fields Post Reply Post New Topic
Author Message
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Topic: Hiding Fields
     Posted: 29 Sep 2011 at 2:12am
Hi..
 
I am making a Purchase Order Confirmation and I have three fields in the report that sometimes have data and sometimes don't have depending on the purchase order.
 
ContractNo:                 VenPartNum                     PartNum
0008                           121212                            0128101
 
Sometimes ContractNo does not have the data in it, so what I'm aiming to do is to show the PartNum in the ContractNo field if ContractNo is empty then don't show the PartNum at all. So it should look something like this.
 
BEFORE
ContractNo:                VenPartNum                      PartNum
                                  121212                             0128101
 
AFTER
ContractNo:                VenPartNum            
0128101                    121212            
 
so instead of having the ContractNo empty, it will be filled with the PartNum and the PartNum won't exist at all.
 
I know it's simple but I get confuse of using the IF statement..
 
What I did is, I created a new Formula Field and put this formula in:
 
if {PODetail.VenPartNum} = "" then yes else if {PODetail.PartNum} ="" then no
 
there's no error but it's not giving me the result that I expected to see.
 
Please help :)
 
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2011 at 4:04am
you need to do 2 fomruals, oncve for duisplay and one for suppression
I am assuming these are all text fields in this formula and they are empty stringhs, not NULLs
for display//
if {PODetail.ContractNo} = "" then {PODetail.PartNum} else {PODetail.ContractNo}
for suppression//
{PODetail.ContractNo}=""
IP IP Logged
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Posted: 29 Sep 2011 at 5:16am
Thanks DBlank :)
 
where do i put these two formulas in?
 
i put the first formula in the existing ContractNo field (display)..not sure where to put the 2nd one though (suppression). So I made a new formula field and put this suppression formula in it, named it as "ContractNoLabel", dragged it in the report but what I get is a "false" result.. :(
 
 


Edited by khyulitz10 - 29 Sep 2011 at 5:17am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2011 at 5:28am

the first one you can use as a display formula inside teh COntractNo field (as you did) or you could create a new formula field and use the formula field in the report canvas where you curretnly have the ContractNo field.

The other uis a suppression formula for PartNo
right click on that field,
select format field,
select common tab
select the formula field nect to 'Suppress'
enter it there
IP IP Logged
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Posted: 03 Oct 2011 at 5:48am
done and it's working! Thank you DBlank :D
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