Focal Point
[CLOSED] Displaying a parameter containing < (left carat) in header

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4677009436

November 26, 2013, 05:37 PM
I.P.
[CLOSED] Displaying a parameter containing < (left carat) in header
I need to display a report title that is passed a parameter (&desc) that may contain a <

Example problem
-SET &DESC = 'Hardware < $10,000';
-SET &HDROBJTITLE='2255' ||(' ' | &DESC);
TABLE FILE CAR
PRINT MODEL
HEADING
"Object Account: &HDROBJTITLE "
END

I tried it with | as an escape character
-SET &STR_LEN_AFTER= &DESC.LENGTH+4;
-SET &HDROBJTITLE=STRREP(&DESC.LENGTH,&DESC, 1,'<', 2,'<|',&STR_LEN_AFTER,'A&STR_LEN_AFTER.EVAL');

But that made the < disappear. Any ideas? I saw a previous solution but that used a define. http://forums.informationbuild...337031106#5337031106

This message has been edited. Last edited by: I.P.,


WF 8.0.3
Windows
Oracle
November 26, 2013, 05:45 PM
njsden
quote:
I saw a previous solution but that used a define.

That's usually the way to go.

If your report runs exclusively in HTML, you may try using STRREP to convert "<" to its equivalent HTML attribute: "&|lt;" -- note the "pipe" character escaping the ampersand which is needed to avoid Dialogue Manager trying to parse the value later on.

I'd go with DEFINE instead. Less manipulation and will work in other formats such as PDF without further changes.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 26, 2013, 05:48 PM
Waz
I agree, DEFINE is the way to go.


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!

November 26, 2013, 07:24 PM
I.P.
Thanks guys, good to know not to bother bashing my head against it. Need it only for excel output but who knows in the future.

Ended up with the following as the solution.
-SET &DESC = 'Hardware < $10,000';
DEFINE FILE CAR
HDROBJTITLE /A46 = '2255' || (' ' | &DESC.QUOTEDSTRING);
END
TABLE FILE CAR
PRINT MODEL
HEADING
"Object Account: "
" END


WF 8.0.3
Windows
Oracle
November 26, 2013, 07:59 PM
njsden
Glad to hear that works for you.

Would you please edit your post and prefix it with [CLOSED]? Thanks.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.