views:

945

answers:

3

I have a report field where its value is "2". I need to display in report as "True" if report field value is 2.How do i do this in Formula editor crystal reports ? Please help me.

EDIT :Here is my code in formual Editor: if( {emp.company_id}=2) Then CStr ({emp.company_id}) ="ABC pvt ltd"

As emp.company_id is integer value i have tried converting it to string but still it displays as 2 in report.

+1  A: 

All you need in the formula is

{Tablename.Fieldname}=2
Martynnw
+1  A: 

What I don't know is what you want to display if it isn't 2. Assuming you want to display the original value then you need to add a formula to your report, as follows:

if ({emp.company_id}=2) then "true"
else cstr({emp.company_id})
paulmorriss
A: 

see the detailed help with pictures

http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-formula-field.htm

gever.

geveruk