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     [SOLVED] Wrap and center header text that falls onto multiple lines

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Wrap and center header text that falls onto multiple lines
 Login/Join
 
Member
posted
Hi, I'm using WebFocus 8x trying to wrap and center the HDRTEXT, but can't figure out any way to center text that falls on multiple lines. Any suggestions?

TABLE FILE CAR
PRINT
CAR
DEALER_COST
RETAIL_COST
SALES
COMPUTE HDRTEXT/A150='THIS IS A LONG TEXT WHICH HAS TO WRAPPED TO TWO OR MORE LINES. CURRENTLY IT IS NOT DISPLAYED PROPERLY DUE TO THE LENGTH OF THE TEXT'; NOPRINT
HEADING
"<HDRTEXT"
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=HEADING,
SIZE=12,
JUSTIFY=CENTER,
STYLE=BOLD,
LINE=1,
WRAP=3,
$
ENDSTYLE
END

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
WebFOCUS 7705
Windows, All Outputs
 
Posts: 19 | Registered: October 28, 2016Report This Post
Expert
posted Hide Post
Hi Ifra, please use the code tags, some of your code got lost.

Not sure if this will work, but could you place a field before and set its width to position your text in the center ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Waz - I updated the post with the code tags, so hopefully it's there now. I actually tried your suggestion and still no luck. The problem is that since there's a WRAP present the multiple lines aren't getting centered.


WebFOCUS 8
WebFOCUS 7705
Windows, All Outputs
 
Posts: 19 | Registered: October 28, 2016Report This Post
Expert
posted Hide Post
Yes, and I just tried using MARKUP and adding
to your text and still the same.

The Justify is being ignored.

Must be a setting or combination of WRAP and JUSTIFY


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Hi Ifra.

My suggestion is "Divide and rule":

1. Divide text into smaller tokens (PARAG introduces a smart delimiter in the text).
2. Extract every line/substring (GETTOK).
3. Finally, you can control each line in the header.

TABLE FILE CAR

PRINT CAR DEALER_COST RETAIL_COST SALES

COMPUTE HDRTEXT/A150 ='THIS IS A LONG TEXT WHICH HAS TO WRAPPED TO TWO OR MORE LINES. CURRENTLY IT IS NOT DISPLAYED PROPERLY DUE TO THE LENGTH OF THE TEXT'; NOPRINT
COMPUTE HDRCDEL/A153 = PARAG(150, HDRTEXT, ',', 50, HDRCDEL) ;    NOPRINT
COMPUTE HDRLIN1/A50  = GETTOK(HDRCDEL, 153, 1, ',', 50, HDRLIN1) ; NOPRINT
COMPUTE HDRLIN2/A50  = GETTOK(HDRCDEL, 153, 2, ',', 50, HDRLIN2) ; NOPRINT
COMPUTE HDRLIN3/A50  = GETTOK(HDRCDEL, 153, 3, ',', 50, HDRLIN3) ; NOPRINT

HEADING
"<HDRLIN1"
"<HDRLIN2"
"<HDRLIN3"
" "

ON TABLE SET PAGE NOLEAD
ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLE *
TYPE=HEADING, JUSTIFY=CENTER, $
END


Regards. Mikel.


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Expert
posted Hide Post
For PDF you can embed HTML tags and use MARKUP=ON to incorporate what you need -

TABLE FILE CAR
PRINT
CAR
DEALER_COST
RETAIL_COST
SALES
-* Added center HTML tags to enforce alignment
COMPUTE HDRTEXT/A150='<center>THIS IS A LONG TEXT WHICH HAS TO WRAPPED TO TWO OR MORE LINES. CURRENTLY IT IS NOT DISPLAYED PROPERLY DUE TO THE LENGTH OF THE TEXT</center>'; NOPRINT
HEADING
"<HDRTEXT"
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=HEADING,
MARKUP=ON, <====
HEADALIGN=BODY, <====
COLSPAN=4, <====
JUSTIFY=CENTER,
SIZE=12,
STYLE=BOLD,
LINE=1,
WRAP=3,
$
ENDSTYLE
END


Note that you will need to remove the <==== which I have used to show where I've made changes.

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
Member
posted Hide Post
@Tony - unfortunately the text is moved to the middle horizontally, but not exactly centered as it's still left aligned. It looks like the
 <center> 
tag isn't getting picked up.

@Mikel - a little bit of a dirty way to do it, but it did the trick! Smiler Thanks.


WebFOCUS 8
WebFOCUS 7705
Windows, All Outputs
 
Posts: 19 | Registered: October 28, 2016Report 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     [SOLVED] Wrap and center header text that falls onto multiple lines

Copyright © 1996-2020 Information Builders