Focal Point
[SOLVED]Rendering Unicode characters

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

January 17, 2016, 04:38 PM
j.gross
[SOLVED]Rendering Unicode characters
I need to produce stock-listing type output, with an up or down arrow-head symbol to indicate positive or negative change in the measure.

For example,

▲ 23.45%

or

▼ -3.21%


I have the Unicode values for the two arrowhead synbols: ▲ = Unicode 25B2, ▼ = Unicode 25BC
and I can stuff those values into a define within a fex.

But when I execute it, the symbols render as "?". Apparently, WF welcomes Unicode in the source code, but reverts to a 265-character alphabet at execution time.

I would rather use this method than graphics -- if I can get it to work with the symbols as text, the result should port nicely across output file formats (html, pdf, etc); and styling can be used to uniformly color the data and the symbol.

Suggestions?

(Currently using 8.1)

This message has been edited. Last edited by: <Emily McAllister>,


- Jack Gross
WF through 8.1.05
January 17, 2016, 04:59 PM
Waz
Don't you need to set the codepage somewhere ?


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!

January 18, 2016, 04:44 AM
SSander
We are on UTF-8 setup and I can easily use ▲ in field titles. I remember there was some workaround to get delta in titles or to text with "D" and assigning special FONT for data or title.
Unfortunately I was not able to find this workaround


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
January 18, 2016, 10:54 AM
CoolGuy
Have you tried this syntax?:

COMPUTE HTMLENTITY/A9 = '&|#x25B2;';

or 

COMPUTE HTMLENTITY/A50 = '<span style="font-size:50px">&|#x25B2;</span>';

to change size...


Works on my end.

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
January 19, 2016, 09:59 AM
EricH
Make sure both WebFOCUS Server & Client Code Page are 65001

Make sure your Web Server is configured to process UTF-8

Make sure that your Web Browser is set to either Auto Detect or UTF8
January 19, 2016, 10:09 AM
John_Edwards
Anybody that wants to speak to this in pdf format as well I'm all ears. We've been trying to get a "less-than-or-equal-to" character into a pdf doc for years. We tried all these tricks.

No reason it shouldn't work but it douldn't work.



January 20, 2016, 03:56 AM
Wep5622
Be careful when you set your servers to code page 65001.
Doing so increases the space requirements for character fields in HOLD-files and can cause fields that previously had no issues fitting in a segment to no longer do so.

That's something we ran into over the weekend, which in our case was quite obvious as it was a HOLD-file in a process that manages authorization to our custom portal - nothing worked at all. Thankfully, that was our test server.

The trouble is, there will probably be cases where this happens, and AFAIK there is no way to know where those will happen until you switch to UTF-8. You'll be chasing the effects for a while.

Or is there some magic trick here? Would love to hear if that's the case.


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 :
January 20, 2016, 04:19 PM
Waz
Another option would be to use images to the up and down.

May have issues with excel though


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!

January 27, 2016, 12:50 PM
<Emily McAllister>
Hello,

You should be able to include those characters without a problem if your codepage is in fact set to 65001.
To help troubleshoot, I would first run the code directly off the Reporting Server. If you get question marks then your issue is there. If it works then you should examine your client.

Let us know your results so we can help you more if needed.
Thanks,
Emily McAllister
Focal Point Moderator
January 28, 2016, 01:10 PM
Tony A
Hi Jack,

Are you still looking for this? I can get it in HTML using the following code, but of course it is no good for PDF or MS Excel.

      COMPUTE GRAPHIC/A8 = IF PCENT GT 0 THEN '&|#x25B2;'
                      ELSE IF PCENT LT 0 THEN '&|#x25BC;'
                      ELSE '&|#x25C0;';


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 
January 28, 2016, 01:28 PM
eric.woerle
For PDF, you need to make sure that font contains the symbol you are looking for. I would suggest using a Unicode font also.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
January 28, 2016, 01:46 PM
Tony A
Managed to get something working for HTML, PDF and EXL07. Not exactly the character that you were looking for but still up and down arrows -

TABLE FILE GGSALES
  SUM DOLLARS
      COMPUTE PCENT/D7.2% = 100 - (DOLLARS / BUDDOLLARS * 100);
      COMPUTE UPDOWN/A1  = IF PCENT GT 0 THEN 'U'
                     ELSE IF PCENT LT 0 THEN 'D'
                     ELSE 'E'; NOPRINT
      COMPUTE ARROW1/A1 = IF PCENT GT 0 THEN HEXBYT(221,'A1')
                     ELSE IF PCENT LT 0 AND &WFFMT.QUOTEDSTRING EQ 'EXL07' THEN HEXBYT(223,'A1')
                     ELSE IF PCENT LT 0 THEN HEXBYT(160,'A1')
                     ELSE HEXBYT(219,'A1');
   BY STCD
ON TABLE PCHOLD FORMAT '&WFFMT.(HTML,PDF,EXL07).Format.'
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
  grid=off, size=10, $
  type=data, column=PCENT, color=green, when=UPDOWN EQ 'U', $
  type=data, column=PCENT, color=orange, when=UPDOWN EQ 'E', $
  type=data, column=PCENT, color=red, when=UPDOWN EQ 'D', $
  type=data, column=ARROW1, font=Symbol, $
  type=data, column=ARROW1, color=green, when=UPDOWN EQ 'U', $
  type=data, column=ARROW1, color=orange, when=UPDOWN EQ 'E', $
  type=data, column=ARROW1, color=red, when=UPDOWN EQ 'D', $
ENDSTYLE
END
-RUN


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 
January 28, 2016, 01:56 PM
Francis Mariani
Tony, in our environment, HTML renders the up arrow, but the down arrow is blank. In PDF the up arrows renders as a Euro symbol. Both arrows work properly in EXL07.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 28, 2016, 02:04 PM
Francis Mariani
'Wingdings 3' works for HTML, EXL07 and EXL2K. It does not work for PDF. But perhaps the Postscript font can be added...

TABLE FILE CAR
PRINT 
COMPUTE UP/A1 = 'p';
COMPUTE DOWN/A1 = 'q';
BY COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=UP, FONT='Wingdings 3', COLOR=GREEN, $
TYPE=DATA, COLUMN=DOWN, FONT='Wingdings 3', COLOR=RED, $
ENDSTYLE

ON TABLE PCHOLD FORMAT EXL07
END

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 28, 2016, 02:11 PM
Tony A
Also tried WebDings using chars 53, 54 & 51 respectively - these are actually the blocked arrow heads. OK in HTML and EXL07 but no good in PDF but that may be because I need to use a font configured in PDF for WF.

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 
January 28, 2016, 02:26 PM
Francis Mariani
From a cursory glance at articles regarding Wingdings, it is suggested it is preferable to use Unicode. It looks like there are only TrueType and OpenType versions of this common Microsoft font.

Apparently it isn't easy to use Unicode in PDF, so we seem to be stuck.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 29, 2016, 04:35 AM
Tony A
quote:
it isn't easy to use Unicode in PDF

You can say that again!

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 
January 31, 2016, 04:01 PM
Waz
You can add other fonts to be available to PDF.

There is a process and tools out there to prepare the necessary files.


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!

January 31, 2016, 08:07 PM
j.gross
@Francis -- That's just what I needed. I only need this in Excel (XLSX), so Wingdings3 fills the bill.

Much thanks.

-Jack