Focal Point
[CLOSED] Spaces in DEFINE - PDF only

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4141048331

March 24, 2005, 07:32 PM
<Lisa M>
[CLOSED] Spaces in DEFINE - PDF only
I'm working on a report which has a relatively simple concatenation define. I want to create a field that is Lastname, Firstname. My problem is that when the PDF is viewed, the space is screwy. Here are a couple of things I tried...

IF KNOWN_AS NE ' ' THEN LASTNAME || ', ' || KNOWN_AS ELSE LASTNAME || ', ' || FIRSTNAME

This removes the space altogether, so my result is Lastname,Firstname


IF KNOWN_AS NE ' ' THEN LASTNAME | ', ' | KNOWN_AS ELSE LASTNAME | ', ' | FIRSTNAME

This gives me between 5 and 10 spaces between the Lastname and the ",". The spacing is not consistent, though....giving me something like:
Lastname_____,Firstname
Lastname__,Firstname
Lastname________,Firstname

I also tried adjusting SQUEEZE, but it only produced the same two results.

I tried creating the define in the master file instead of the report, but it didn't help either.

Just FYI, I'm using Dev Studio 523.

Any help would be much appreciated!
Lisa

This message has been edited. Last edited by: <Kathryn Henning>,
March 24, 2005, 08:09 PM
reFOCUSing
Are you trying to create Lastname,_Firstname?
If so you can do it as follows:
LASTNAME || ', ' | FIRSTNAME
March 24, 2005, 08:19 PM
<Joseph Coule>
Yeah... what he said. Smiler It's a mix of hard concat (||) to remove trailing spaces and soft concat (|) to retain the single space after the comma.

The results of soft concatenation can look different between html and anything else (e.g. PDF or Excel), because html will automatically condense extra spaces, but PDF will not.

Does that help?

JC

(p.s. edited to fix typo)
March 24, 2005, 08:24 PM
reFOCUSing
The solution I gave will only work if FIRSTNAME has no leading blanks.
March 25, 2005, 02:10 AM
Kamesh
try this,

DEFINE FILE TABNAME
LNAME/A32V=TRIMV('B',LAST_NAME,32,' ',1,LNAME);
FNAME/A32V=TRIMV('B',FIRST_NAME,32,' ',1,FNAME);
NAME/A40=LNAME | ', ' | FNAME;
END
March 26, 2005, 10:16 PM
Piipster
You may still get some inconsistent spacing with

LASTNAME || ', ' | FIRSTNAME


Make sure you use ( ) around the last part.

LASTNAME || (', ' | FIRSTNAME )
March 28, 2005, 04:24 PM
<Lisa M>
Thanks for all the input. Unfortunately, I've tried the combo of || and |, as well as the (), but I get no spaces between the , and the first name (my result is: Mych,Lisa). There are no spaces leading the first name or known as fields, it looks as though the extra spaces are coming from the end of the last_name field.
March 28, 2005, 04:46 PM
<Lisa M>
OK, I re-tried using the () and it worked this time. Thanks so much for all the help! Smiler
June 11, 2014, 03:50 AM
Nadanasababathy
How to define the spacesin PDF only


Web focus 7.6.11
All outputs
June 20, 2014, 06:59 PM
<Kathryn Henning>
Hi Nadanasababathy,

Using the techniques in this topic, what are the results that you're seeing? Are you not getting any spaces between fields in PDF, or are you getting too many spaces or spaces not in the desired location?

Thanks and regards,

Kathryn
June 21, 2014, 02:29 PM
Ramkumar - Webfous
quote:
How to define the spacesin PDF only


If you have an &variable for Dynamic Output Format, then use that in the IF clause while defining this field..

 NAME/A40=IF &OPFORMAT EQ 'PDF' THEN LNAME | ', ' | FNAME ELSE 'NOSPACE_LOGIC_PLEASE; 



Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5