[WORKAROUND]How can I print a check mark (tick) in a report?
I would like to create a field that contains the check mark. Is that possible? The ideal result would be a little square box that could containt the tick sign. Any idea? Thanks.This message has been edited. Last edited by: MSIROTTI,
Webfocus 7.7.3 Oracle Windows Server 2003 Output: PDF, HTML(A), EXCEL
Webfocus 7.7.3 Oracle Windows Server 2003 Output: PDF, HTML(A), EXCEL
June 18, 2013, 02:52 PM
MSIROTTI
I did not find a quick way to do it in PDF (no problem in HTML) but i find the way a print the sign "square-root" that is close enough. [ code ] DEFINE FILE CAR UK/A1=IF COUNTRY EQ 'ENGLAND' THEN HEXBYT(214,'A1') ELSE ' '; FR/A1=IF COUNTRY EQ 'FRANCE' THEN HEXBYT(214,'A1') ELSE ' '; IT/A1=IF COUNTRY EQ 'ITALY' THEN HEXBYT(214,'A1') ELSE ' '; JP/A1=IF COUNTRY EQ 'JAPAN' THEN HEXBYT(214,'A1') ELSE ' '; AL/A1=IF COUNTRY EQ 'W GERMANY' THEN HEXBYT(214,'A1') ELSE ' ';
END
TABLE FILE CAR PRINT CAR MODEL UK FR IT JP AL ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=DATA, COLUMN=UK, FONT='SYmbol', $ TYPE=DATA, COLUMN=FR, FONT='SYmbol', $ TYPE=DATA, COLUMN=IT, FONT='SYmbol', $ TYPE=DATA, COLUMN=JP, FONT='SYmbol', $ TYPE=DATA, COLUMN=AL, FONT='SYmbol', $
ENDSTYLE END [ /code ]
Webfocus 7.7.3 Oracle Windows Server 2003 Output: PDF, HTML(A), EXCEL
June 19, 2013, 01:16 AM
njsden
Why not having the checkmark you want as a tiny image (.jpeg or .gif) and just include it as part of the data in your report? Provided the image is available somewhere in your Reporting Server (not the Web/App Server) you should have no problem at adding it to your PDF output.
The only reason I try to avoid "special characters" is that your report may not be so easy to port to other environments that use different character sets and/or code pages, whereas an image is an image is an image
Do a search on "checkmarks" or "wingdings" on this forum. You'll find a good solution there.
WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
June 19, 2013, 11:19 AM
MSIROTTI
njsden: the problem is that the image has to be defined in a field A256 and in PDF that seems to be really 256 char.
Alex: wingdings is fine in HTML, but it doesn't work in PDF, as it was specified in the link in a previous post.
Thank you both anyway.
Webfocus 7.7.3 Oracle Windows Server 2003 Output: PDF, HTML(A), EXCEL
June 19, 2013, 11:39 AM
MSIROTTI
Alex: in the search I've found the suggestion of use the font Zapfdingbats; I'll try that, even though I admit that this is a real checkmark and not a square root
Webfocus 7.7.3 Oracle Windows Server 2003 Output: PDF, HTML(A), EXCEL
June 19, 2013, 11:52 AM
njsden
quote:
the problem is that the image has to be defined in a field A256 and in PDF that seems to be really 256 char.
@MSIROTTI, I don't think I understand why that seems to be an issue
DEFINE FILE CAR
CHECKIT/A256 = IF COUNTRY EQ 'JAPAN' OR CAR EQ 'MASERATI' THEN 'icon_check_green.jpg' ELSE '';
END
TABLE FILE CAR
PRINT
CAR AS 'Car'
COUNTRY AS 'Country'
CHECKIT AS 'Chk'
SEATS AS 'Seats'
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, UNITS=PTS, FONT='Arial', SIZE=11, BORDER=1, $
TYPE=DATA,COLUMN=CHECKIT,IMAGE=(CHECKIT),SIZE=(16 16),PRESERVERATIO=ON,$
ENDSTYLE
END
-RUN
Provided 'icon_check_green.jpg' is available somewhere in your APP PATH, you would get a PDF document looking like this:
Your variable length only needs to be as "big" as the image's file name, which is my example above is just 20 characters. Therefore, using CHECKIT/A20 worked just as fine and the result output is similar.
MSIROTTI, zapfdingbats will work nicely for you in PDF format if you can do with a basic check mark and standard WebFocus styling.
If you need a more stylized version, then images, as NJ describes, is the way to go.
Here's my code example showing how to code a PDF, HTML, EXL2K, and AHTML checkmark:
-SET &FORMAT='PDF';
TABLE FILE CAR
SUM
COMPUTE CHECK/A70=IF '&FORMAT' EQ 'PDF'
THEN '3'
ELSE '<font size="4" color="GREEN" face="wingdings 2"> &|#80 </font>';
BY COUNTRY
ON TABLE PCHOLD FORMAT &FORMAT
ON TABLE SET STYLE *
TYPE=REPORT, GRID = OFF, SQUEEZE=ON,$
TYPE=DATA, COLUMN=N2,COLOR=BLUE,SIZE=15, FONT='zapfdingbats', $
ENDSTYLE
END
In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
June 20, 2013, 02:27 PM
susannah
wfiw, the font wingdings 2, the upper case P is a plain checkmark; the upcase Q,R,S,T, U and V are interesting variations on the theme. and the html spec character code for upper case letters are #65 thu #90 (the leading & being understood ) so DavSmith above uses #80 for that upper case P, and sets the font to windings 2 and voila!
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID