Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Hide part... Post Reply Post New Topic
Author Message
Wosp
Groupie
Groupie
Avatar

Joined: 05 Sep 2012
Location: Sweden
Online Status: Offline
Posts: 45
Quote Wosp Replybullet Topic: Hide part...
     Posted: 05 Oct 2014 at 9:45pm
On a report I have fields that shows sender and receiver.
As a sender/reciever it could be Productionleader or Productionleader John W.
On the report it looks like this:
PRODUCTIONLEADER/JOHN W or just PRODUCTIONLEADER/

I would like to hide everything after the / including the / itself.
So PRODUCTIONLEADER/JOHN W or PRODUCTIONLEADER/BILL H
is displayed as just PRODUCTIONLEADER

How do i do?

IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 05 Oct 2014 at 9:58pm
you can use the following formula
 
IF instr({field},"/")>0 THEN
left({field},instr({field},"/")-1)
ELSE
{field}


Edited by z9962 - 05 Oct 2014 at 11:19pm
IP IP Logged
Wosp
Groupie
Groupie
Avatar

Joined: 05 Sep 2012
Location: Sweden
Online Status: Offline
Posts: 45
Quote Wosp Replybullet Posted: 05 Oct 2014 at 11:01pm
Originally posted by z9962



you can use the following formula
 
IF instr(0'>{field},"/")>0 THEN    left({field},instr({field},"/")-1)ELSE     {field}


I got this part highlighted:
0'>{AO.MOT},"/")>0 THEN
and the error message "The matching' for this string is missing"
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 05 Oct 2014 at 11:05pm
is your ao.mot data milti lined?
IP IP Logged
Wosp
Groupie
Groupie
Avatar

Joined: 05 Sep 2012
Location: Sweden
Online Status: Offline
Posts: 45
Quote Wosp Replybullet Posted: 05 Oct 2014 at 11:11pm
Originally posted by z9962



is your ao.mot data milti lined?


I dont know what you mean by that   

I got one field for sender called AO.MOT
And one for receiver called AO.BEST

IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 05 Oct 2014 at 11:14pm
the output may appear on more than one line??
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 05 Oct 2014 at 11:20pm
sorry i just saw the error, not sure what happened when I wrote my formula the first time.
 
use
IF instr({field},"/")>0 THEN
left({field},instr({field},"/")-1)
ELSE
{field}
IP IP Logged
Wosp
Groupie
Groupie
Avatar

Joined: 05 Sep 2012
Location: Sweden
Online Status: Offline
Posts: 45
Quote Wosp Replybullet Posted: 05 Oct 2014 at 11:22pm
Originally posted by z9962



the output may appear on more than one line??


Yes I could go out to two lines.
Btw exactly where should I put this formula, maybe i did wrong there...
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 05 Oct 2014 at 11:26pm
sorry, it was my fault, i wrote the formula wrong. Try again please. you can put the formula in the details section of the report.
IP IP Logged
Wosp
Groupie
Groupie
Avatar

Joined: 05 Sep 2012
Location: Sweden
Online Status: Offline
Posts: 45
Quote Wosp Replybullet Posted: 05 Oct 2014 at 11:36pm
Yupp now its working, i did wrong myself but finally i put it in the right place.
Thank you very much for your effort
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