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.
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,
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.
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
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, 2004