We have amper variable storing a number of labels separated by '|' . Need to show each label on new line in the header. For eg. an amper variable like &label_header = 'canada|germany|us|mexico'
The above variable string should get split and show each country on new line on the header.
"Report" country: canada germany us mexico
Thanks in advance.This message has been edited. Last edited by: sladkat,
Supriya WF 7.7.02/8.0
July 12, 2012, 12:07 PM
j.gross
Use the GETTOK() function.
July 12, 2012, 01:18 PM
Dan Satchell
If the text will be used in a HEADING, this might work. It breaks the text into separate HEADING lines by replacing each | character with a set of double quotes separated by a carriage return.
In effect, canada|germany|us|mexico becomes
canada" "germany" "us" "mexico
-SET &LABEL_HEADER = 'canada|germany|us|mexico';
-SET &NEW_LINE = '"' | HEXBYT(13,'A1') | '"';
-SET &OUT_LENGTH = &LABEL_HEADER.LENGTH + 50 ;
-SET &LABEL_BREAK = STRREP(&LABEL_HEADER.LENGTH,&LABEL_HEADER,1,'|',3,&NEW_LINE,&OUT_LENGTH,'A&OUT_LENGTH.EVAL');
-*
TABLE FILE CAR
HEADING
"Country: &LABEL_BREAK"
PRINT COUNTRY AS ''
END
WebFOCUS 7.7.05
July 12, 2012, 06:08 PM
Waz
A variation on Dans suggestion is multiplatform.
-SET &LABEL_HEADER = 'canada|germany|us|mexico';
-SET &OUT_LENGTH = &LABEL_HEADER.LENGTH + 50 ;
-SET &LABEL_BREAK = STRREP(&LABEL_HEADER.LENGTH,&LABEL_HEADER,1,'|',4,'</1>',&OUT_LENGTH,'A&OUT_LENGTH.EVAL');
TABLE FILE CAR
HEADING
"Country: &LABEL_BREAK"
PRINT COUNTRY AS ''
END
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
July 13, 2012, 04:34 AM
Dave
This will work to:
-SET &LABEL_HEADER = 'canada </1 germany </1 us </1 mexico';
TABLE FILE CAR
SUM SALES
BY COUNTRY
HEADING
"&LABEL_HEADER"
END