Focal Point
Carriage Returns
January 21, 2008, 06:29 PM
LaurieCarriage Returns
This function works fine except that it returns an extra line feed between the first and second line every time. I am on version 7.6.4. Does anyone know why it is doing this and how to fix it?
DEFINE FILE EMPLOYEE
ANLB/A40 ='THIS IS AN EXAMPLE;OF TEXT;WITH A LINE BREAK;THAT ALWAYS RETURNS;AN EXTRA LINE BREAK.';
ANLBC/A40 = CTRAN(40, ANLB, 059, 013, ANLBC);
END
TABLE FILE EMPLOYEE
PRINT LAST_NAME ANLBC
WHERE LAST_NAME EQ 'BLACKWOOD'
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,LINEBREAK='CR',$
ENDSTYLE
END
That function works great except it returns this:
THIS IS AN EXAMPLE
OF TEXT
WITH A LINE BREAK
THAT ALWAYS RETURNS
AN EXTRA LINE BREAK.
January 21, 2008, 06:44 PM
N.SelphI had to change the length of ANLB and ANLBC to 86 from 40 (the string is longer than 40) to get it to run. But when I did that I got a different result than yours (mine is still wrong).
THIS IS AN EXAMPLE
OF TEXT W
ITH A LINE BREAK T
HAT ALWAYS RETURNS A
N EXTRA LINE BREAK.
(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
January 21, 2008, 07:25 PM
Darin Leeif you put a space after each ; delimiter, it displays correctly. Not sure why-- possibly in the way that it is determing what constitutes the carriage return.
(I'm on version 7.1.6. someone will have to check on 764)
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
January 22, 2008, 02:20 AM
Tony AWith the changes mentioned by Nicola, and the HOLD changed to PCHOLD, I get the correct output on 7.6.2.
Code used -
DEFINE FILE EMPLOYEE
ANLB/A86 ='THIS IS AN EXAMPLE;OF TEXT;WITH A LINE BREAK;THAT ALWAYS RETURNS;AN EXTRA LINE BREAK.';
ANLBC/A86 = CTRAN(86, ANLB, 059, 013, ANLBC);
END
TABLE FILE EMPLOYEE
PRINT LAST_NAME ANLBC
WHERE LAST_NAME EQ 'BLACKWOOD'
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,LINEBREAK='CR',$
ENDSTYLE
END
Returned text was -
THIS IS AN EXAMPLE
OF TEXT
WITH A LINE BREAK
THAT ALWAYS RETURNS
AN EXTRA LINE BREAK.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
January 22, 2008, 05:06 AM
Alan BIn 7.6.4 I get the expected result, correct line breaking, with HOLD and PCHOLD.
I know that in 7.1.3 there was a need to use a null or a blank after the break for it to work properly, which I documented here somewhere.
If you want to retain text indentation at the start of a new line (text entered via a multi edit for example), there is an extra step needed, but it can be done.
Alan.
WF 7.705/8.007
January 22, 2008, 09:52 PM
LaurieWhen I add an extra space around the ; it still puts in an extra carriage return and it is only after the first line. Makes no sense to me why it would only do it for the first line. It is no different than the rest. I am passing the data in via SQL stored procedure so I can add a non carriage return character, if there is one.
I'm using CTRAN function so I am not sure how I would handle that though.
January 23, 2008, 03:12 AM
Alan BLaurie
Can you try outputting to a SAVE file and then opening that with your text editor, also check it in hex to check the carriage return.
I am on the same release/OS as you and I get your example (changing the A40 to A86) to work fine.
Alan.
WF 7.705/8.007