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     Using CTRAN to insert a carriage return

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using CTRAN to insert a carriage return
 Login/Join
 
Member
posted
We have an address field that as it is returned from the database is a single line. We would like to display it in several rows like an address would normally be displayed. As luck would have it there are commas in exactly the right spots for the line breaks so we are trying to use CTRAN to swap the commas for a CR. The code looks like this:

DEFINE FILE MATERIEL_AV_VQL_WHOLESALE_RETAIL_INVENTORY
ADLT/A2000 = CTRAN(2000, ADDR_LONG_TEXT, 44, 13, ADLT);
END
Then we call ADLT in the PRINT portion of the .fex. Unfortunately what we get is the commas are successfully removed but the carriage return is not inserted. We have also tried it with a LineFeed with the same results.


WebFOCUS 7.6.1
OS - Solaris 10
HTML, EXL2K, PDF, PPT, DOC
 
Posts: 4 | Registered: January 15, 2008Report This Post
Expert
posted Hide Post
Dave,

Use STRREP to replace the comma with a CR and LF. You can use it to replace one or more characters with a different number of characters.

You can create these two chars by using the BYTVAL function to convert the ASCII chars for 13 and 10.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
What is your output?

For HTML you need to use
<BR>


For PDF you need to use LINEBREAK in the stylesheet.

Use STRREP as Tony suggested.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
OK - I am using the normal line break for the HTML output and it has always worked fine. Now they want to give the user the option to run the report in PDF or PPT so this is where I have run into trouble.

I added LINEBREAK in the stylesheet and got more than I bargained for. There were unexpected linebreaks in random places and then a bunch of "noise" at the end of the legit data. The "noise" looked like this:

ı.
ı
ı
ı .
�cR�


WebFOCUS 7.6.1
OS - Solaris 10
HTML, EXL2K, PDF, PPT, DOC
 
Posts: 4 | Registered: January 15, 2008Report This Post
Member
posted Hide Post
I have checked the data as throughly as possible. The data does not contain any of it's own linebreaks so it should only be breaking at the comma where I told it to using CTRAN. Also the does not appear to be any explanation of where the "noise" at the end of the data is coming from. Could this be a bug in CTRAN? Is there another way for me to do this besides using CTRAN? I can't figure out how to use STRREP when I want to replace a comma with a carriage return.


WebFOCUS 7.6.1
OS - Solaris 10
HTML, EXL2K, PDF, PPT, DOC
 
Posts: 4 | Registered: January 15, 2008Report This Post
Virtuoso
posted Hide Post
Dave

This sounds familiar.

In the past I have used ARGLEN + CTRAN, but have never managed a one step due to my data. try this though:
lfText/A2000V = CTRAN(ARGLEN(2000, ADDR_LONG_TEXT,'I4'), ADDR_LONG_TEXT, 44, 13, lfText);

In these circumstances STRREP will not work.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
Have you tried using newline (0Ax) as follows?

quote:
DEFINE FILE MATERIEL_AV_VQL_WHOLESALE_RETAIL_INVENTORY
ADLT/A2000 = CTRAN(2000, ADDR_LONG_TEXT, 44, 10, ADLT);
END


WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Report This Post
Member
posted Hide Post
Alan - Thank you. That worked beautifully.


WebFOCUS 7.6.1
OS - Solaris 10
HTML, EXL2K, PDF, PPT, DOC
 
Posts: 4 | Registered: January 15, 2008Report 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     Using CTRAN to insert a carriage return

Copyright © 1996-2020 Information Builders