Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
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
Go
New
Search
Notify
Tools
Reply
  
[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, 2016Reply With QuoteReport 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.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6270 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport 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, 2016Reply With QuoteReport 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.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6270 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport 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, 2003Reply With QuoteReport 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: 5681 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport 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, 2016Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.