Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]convert 'line break' from html to pdf document

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]convert 'line break' from html to pdf document
 Login/Join
 
Member
posted
hi all

In an html file a user can fill out a text field.

it will be sent to the variable &TEXTFIELD and displayd on an pdf compound document.

all line breaks are disapearing and it will write everything on one line. I tried to convert this line breaks but without success so far.

  
-SET &TEXTFIELD = TRIMV('B', STRREP(1000,&TEXTFIELD.QUOTEDSTRING,2,HEXBYT(013, 'A1')|HEXBYT(010, 'A1'),4,'<BR>',1000,'A1000V'), 1000, ' ', 1, 'A1000V');


not sure if HEXBYT is only for html but not for pdf. should I work with CR and LF? any idea how to achieve this or any links for documentation (which I couldn't find yet).

many thanks

This message has been edited. Last edited by: Tamra,


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
 
Posts: 23 | Registered: May 28, 2013Report This Post
Expert
posted Hide Post
CRLF/A2= HEXBYT(13,'A1') | HEXBYT(10,'A1');
D_C/A2500= 'D. Explanation:'| CRLF | D_COMMENTS;

for pdf output from a very old application written in 7.1.4. {ouch! hey I still think 4.3.6 rocks]

in 77, I now just use commas in my col titles, no hexbytes needed. don't know about 8.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
hi susannah

thank you for the suggestion. I do not get it to work. here my example with the car data base:

DEFINE FILE CAR
CRLF/A2= HEXBYT(13,'A1') | HEXBYT(10,'A1');
COUNTRY_NEWLINE_CAR/A100= COUNTRY |CRLF| CAR ;
END

TABLE FILE CAR
PRINT COUNTRY_NEWLINE_CAR 
ON TABLE PCHOLD FORMAT PDF
END


instead of a line break I get some spaces and a square. Maybe that worked with your version 4.3.6, but I do not have this available Wink


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
 
Posts: 23 | Registered: May 28, 2013Report This Post
Master
posted Hide Post
From the Help File
quote:

Example: Displaying an Alphanumeric Field With Line Breaks in a PDF Report
The following request defines an alphanumeric named ANLB field with a semicolon (in an EDCDIC environment) or a circumflex (in an ASCII environment) in the middle. The CTRAN function then replaces the semicolon or circumflex with a carriage return character and stores this string in a field named ANLBC. On the report output, this field displays on two lines:

DEFINE FILE EMPLOYEE
ANLB/A40 ='THIS IS AN An FIELD;WITH A LINE BREAK.';
ANLBC/A40 = CTRAN(40, ANLB, 094, 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


For PDF you need to define your linebreak character

quote:

Using StyleSheet attributes, you can display An (character) and AnV (varchar) fields that contain line breaks on multiple lines in a PDF or PostScript report. Line breaks can be based on line-feeds, carriage-returns, or a combination of both. If you do not add these StyleSheet attributes, all line-feed and carriage-return formatting within these fields will be ignored, and all characters will be displayed on one line that wraps to fit the width of the report.


--------------------------------------------------------------------------------
Top of page
--------------------------------------------------------------------------------


xx
Syntax: How to Display An and AnV Fields Containing Line Breaks on Multiple Lines
TYPE=REPORT,LINEBREAK='type',$
where:

REPORT
Is the type of report component. TYPE must be REPORT. Otherwise an error will result.
'type'
Specifies that line breaks will be inserted in a report based on the following:
LF inserts a line break after each line-feed character found in all An and AnV fields.

CR inserts a line break after each carriage-return character found in all An and AnV fields.

LFCR inserts a line break after each combination of a line-feed character followed by a carriage-return character found in all An and AnV fields.

CRLF inserts a line break after each combination of a carriage-return character followed by a line-feed character found in all An and AnV fields.

Note: The report output must be formatted as PDF or PostScript.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Member
posted Hide Post
thank you for your help, but I still can't get it to work.

My Example with an html and a fex file.

when debuggin the html output there is clearly a "CRLF" as line brake, but I'm not able to convert it.

any ideas?


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
 
Posts: 23 | Registered: May 28, 2013Report This Post
Member
posted Hide Post
we could fix it with some javascript code in the html page:

 function parseText(){
 //   alert("test");
    var _txt = document.getElementById("textarea1").value;
    document.getElementById("textarea1").value = _txt.replace(/(?:\r\n|\r|\n)/g,"<br>");
}
 


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
 
Posts: 23 | Registered: May 28, 2013Report This Post
Expert
posted Hide Post
APP PREPENDPATH IBISAMP
DEFINE FILE CAR
CRLF/A2= HEXBYT(13,'A1') | HEXBYT(10,'A1');
COUNTRY_NEWLINE_CAR/A100= COUNTRY |CRLF| CAR ;
END

TABLE FILE CAR
PRINT COUNTRY_NEWLINE_CAR
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,LINEBREAK='CRLF',$
END
-RUN




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]convert 'line break' from html to pdf document

Copyright © 1996-2020 Information Builders