Guddu
Guddu

Reputation: 627

Set report field value in crystal reports

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.

Upvotes: 0

Views: 3900

Answers (2)

paulmorriss
paulmorriss

Reputation: 2615

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})

Upvotes: 1

Martynnw
Martynnw

Reputation: 10915

All you need in the formula is

{Tablename.Fieldname}=2

Upvotes: 1

Related Questions