Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If taxvalue 0 then this field is invisible else visible

how to set formula field in Crystal report?

What I have tried:

if(taxper31.text == 0)
{
taxper31.visible = false;
taxamt31.Visible = false;
}
else
{
taxper31.visible = True;
taxamt31.Visible = True;
}
Posted
Updated 7-Jun-16 9:37am
v6

1 solution

This formula should be an expression rather than a code as you have written.
The expression should evaluate to true or false as we have in SSRS reports as below:-

SQL
=IIf(taxper31.text == 0, true, false)



In your case you may try as below:-

You need to define a suppress formula for the object to accomplish this?

Right click on the text box >> Go to formula field >> Common tab >> suppress X2 formula
and type a formula like this:-

SQL
if {table.Field} = 0 then true else false




Hope this is of help to you.
 
Share this answer
 
Comments
Sabhani Vipul 8-Jun-16 6:11am    
Really i like this solution. but i hve also invisible one text object
like this-> if{table.Field} = 0 then text object.visible = false else true

Thank For The Help
SRS(The Coder) 8-Jun-16 11:02am    
most welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900