Focal Point
forcing carriagereturn linefeed into /A field for pdf

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

May 25, 2008, 10:25 AM
susannah
forcing carriagereturn linefeed into /A field for pdf
has anyone been able to force a cr/lf into a text field, (not with html br tag), so that it would be respected in a pdf output?
newfield/A200=oldfield1 | ? | oldfield2;
its the value of the ? field i'm looking for.
If i could find an example of one, (they usually show up as a little square box in a txt file), i could copy it and paste into a BYTVAL function to grab the HEXBYT of it, but i can't find one, so i tried to make one, no luck so far.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 25, 2008, 12:09 PM
FrankDutch
Susannah
I know my colleague has found a solution for this.
He does a replacement of a certain character with the formula STRREP, but the main thing is the cr/lf character.

Something like "\x0d\x0a" ?? or 0x0D and 0x0A ??

I'll let you know tomorrow.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 25, 2008, 12:28 PM
susannah
oh...dank u , Amsterdam




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 25, 2008, 01:01 PM
Alan B
I think I use CTRAN 10 for a line feed and LINEBREAK=LF in the stylesheet.


Alan.
WF 7.705/8.007
May 26, 2008, 07:46 AM
FrankDutch
Susannah

What Alan does is exactly what we do with some smart remarks.
The code LINEBREAK=LF is removed when you open the report in the GUI (7.1.4)

And we put an empty character before the "10".
PDF seems to have the "functionality" of removing one character before this one.

You can translate the normal charcaters for linefeed wit the CTRAN formula.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 26, 2008, 08:40 AM
susannah
Frank, sorry i don't understand. Can you show me an example?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 26, 2008, 10:11 AM
Francis Mariani
That sounded like Dutch to me too Smiler


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 26, 2008, 10:52 AM
FrankDutch
Well an example....

Suppose you put an "^#" instead of a normal CRLF in your document then

TEMP_BREAK_1/A2='^#';
TEMP_BREAK_2/A2=CTRAN(2, TEMP_BREAK_1, 35, 10, TEMP_BREAK_2);
PDF_BREAK/A2=CTRAN(2, TEMP_BREAK_2, 94, 0, PDF_BREAK);


This translate that text to a PDF ready formatted field.

The formula TEMP_BREAK_2 translates the "#' to the proper LF character (10) and the secand command puts a non readable character in front of that by changing the "^".
Now together this should do it.
Maybe there is a better way....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 26, 2008, 11:26 AM
Francis Mariani
I couldn't get that to work with this code (Win, v765):

SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
TABLE FILE CAR
PRINT

COMPUTE TEMP_BREAK_1/A2='^#'; NOPRINT
COMPUTE TEMP_BREAK_2/A2=CTRAN(2, TEMP_BREAK_1, 35, 10, TEMP_BREAK_2); NOPRINT
COMPUTE PDF_BREAK/A2=CTRAN(2, TEMP_BREAK_2, 94, 0, PDF_BREAK); NOPRINT

COMPUTE TEST1/A100 = EDIT(COUNTRY,'99999$$$$$') | PDF_BREAK | EDIT(COUNTRY,'$$$$$99999');

BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT PDF
END






Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 26, 2008, 01:11 PM
FrankDutch
Francis

in your country fields there is not something like "^#" you now just put some space in the field.

if you first put the "^#" into the country field it would work. (I hope)

NEWCOUNTRY/A25=EDIT(COUNTRY,'999999')||'^#'||EDIT(COUNTRY,'$$$$$$9999999999999');




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 27, 2008, 05:09 AM
Tony A
S,

You can also use STRREP as well, which is the method I prefer, I also use a carriage return with the linefeed.

STRREP(100, TEST1, 2, '^#', 2, HEXBYT(13, 'A1')|HEXBYT(10, 'A1'), 100, REAL_LF);

However, it still needs the stylesheet setting LINEBREAK=LF, as per Alan, to actually get the carriage return / linefeed to impact the output.

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 
May 27, 2008, 09:14 AM
susannah
T, can you put this into a car fex?
i'm just not getting it .
are you saying
create a character/A2 = HEXBYT(13,'A1')|HEXBYT(10,'A1');
stick that intothe middle of my output
new/A10=OLD | character | OLD2;
If so,
then where does the LINEBREAK=LF go?
is it a style sheet attribute like
TYPE=DATA,COLUMN=new,LINEBREAK=LF ??
or am i making this all up?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 27, 2008, 09:27 AM
Francis Mariani
SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
TABLE FILE CAR
PRINT

COMPUTE TEMP_BREAK_1/A2='^#'; NOPRINT
COMPUTE TEMP_BREAK_2/A2=CTRAN(2, TEMP_BREAK_1, 35, 10, TEMP_BREAK_2); NOPRINT
COMPUTE PDF_BREAK/A2=CTRAN(2, TEMP_BREAK_2, 94, 0, PDF_BREAK); NOPRINT

COMPUTE TEST1/A100 = EDIT(COUNTRY,'99999$$$$$') | PDF_BREAK | EDIT(COUNTRY,'$$$$$99999');

BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,LINEBREAK='LF',$
ENDSTYLE
END


This works in 7.6.5.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 27, 2008, 09:36 AM
susannah
DEFINE FILE CAR
  CR/A1 = HEXBYT(13, 'A1');
  LF/A1 = HEXBYT(10, 'A1');
  CRLF/A2 = CR || LF;
 
  ABC5/A30=CAR || CRLF || COUNTRY;
END
TABLE FILE CAR
SUM ABC5 BY CAR BY COUNTRY
      
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,LINEBREAK='CRLF',$
ENDSTYLE
END

GOT IT!
THANK YOU T, FRANKIE, AMSTERDAM,ALAN!
'Nashville Iced Tea' on me!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 27, 2008, 09:38 AM
FrankDutch
This works in 7.1.3 too.

all together...! Big Grin




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 27, 2008, 09:41 AM
Francis Mariani
Thanks for the code Frank. It will come in handy.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 27, 2008, 09:43 AM
FrankDutch
quote:
'Nashville Iced Tea'


Yummy

Nice Thread




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7