Focal Point
[CLOSED] Encoding special characters for GRAPHs

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

February 28, 2011, 09:31 AM
Wep5622
[CLOSED] Encoding special characters for GRAPHs
I've run into some issues with GRAPHs when legend-labels contain special characters. I've found that some can simply be mapped to Unicode characters using HEXBYT, that's not a problem.

However, some of these characters I shouldn't need to convert (quote(") is one of them) or their Unicode alternative lies outside the range of what HEXBYT accepts - I could use char 8343 instead of quote("), for example, but HEXBYT wraps that back to 151.

Next to that, I'd rather not convert these characters case-by-case, that's hardly future-proof. Isn't there some function to encode special characters in a string in such a way that they can safely be used in GRAPH legends?

For example, we have a column alias '10"' (which stands for '10 inch'). If used as a column in a GRAPH, the quote(") is stripped off the label, and the label next to it, whatever it read, is turned into a comma(,).

The columns and their aliases are generated from our data, so converting them on a case-by-case basis is going to cause problems in the future when other data enters the GRAPH.

I can't be the first person running into this problem, what's the recommended solution?

This message has been edited. Last edited by: Kerry,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
February 28, 2011, 09:51 AM
Wep5622
Here's some example-code, to explain why I'm having this problem:
TABLE FILE CAR
SUM
	CNT.CAR AS ''
ACROSS COUNTRY
ON TABLE HOLD FORMAT FOCUS
END
-RUN

FILEDEF TMP DISK FOCCACHE/TMP
-RUN
CHECK FILE HOLD HOLD AS TMP
-RUN
DEFINE FILE TMP
	NAM/A10 = EDIT(FIELDNAME, '9999999999');
	FLD/A10 = STRREP(10, NAM, 1, 'A', 1, HEXBYT(8243, 'A1'), 10, 'A10');
	LBL/A80 = EDIT(ALIAS, '999') | ' AS ''' | FLD | '''';
END
TABLE FILE TMP
PRINT LBL AS ''
WHERE FLDNO GT 1;
ON TABLE HOLD AS FLDS FORMAT ALPHA
END
-RUN

GRAPH FILE HOLD
SUM
-INCLUDE FLDS

END



WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
March 02, 2011, 03:55 AM
Wep5622
Gosh, not even a suggestion on how to go about this? (bump)


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
March 02, 2011, 06:29 AM
GamP
HEXBYT is for character values up to 255 - which is the maximum a A1 field can hold. I think it is actually even for values up to 127, because the sign bit of the byte is not used.
I had some problems also with assinging special characters to legend and/or tick values. I ended up doing this in the advanced graph editor and there you can do something, but it is also quite limited.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988