how to display special characters

msalva

New Member
Hi,

I want to print reports and redirect output to a file or a PDF file using special characters to draw a box,
for example chr(218) for left upper corner, chr(191) right upper corner,chr(217) right lower corner, etc.

┌───┐
└───┘

I already found here that these special characters should be found in the IBM850 codepage, i try with the following code but it does't work.

DEF VAR ttt AS INTEGER.
Repeat ttt = 191 to 218:
DISP ttt CHR(ttt,"ibm850").
End.

When i run the following:

Display chr(192), Progress show this character: À
but i want this character:

In this site I read that the ibm850 codepage already has the characters that i want, if that where true i should be capable to run the next code and get what i want without changing the startup parameters:

DISP CHR(192,"ibm850").

With this Progress change the output display, it display a dot "." not the that i want.

I understant that i can change the ibm850.dat file and 'add' the characters that i want, then with the command proutil -C codepage-compiler generate a new convmap.cp.

My question is: how i can change the ibm850 to add the characters that i want?.

Or, do you know a easier way to display this special characters.


Please, help.
 

rstanciu

Member
no no ... it work's very well your example, but you have to start your progress session with -cpstream ibm850 and configure your terminal to the encoding ibm850.
 

Attachments

  • Capture-rares@rs: -home-rares-tmp - Terminal - Konsole.jpg
    Capture-rares@rs: -home-rares-tmp - Terminal - Konsole.jpg
    20.3 KB · Views: 43

rstanciu

Member
no no ... it work's very well your example, but you have to start your progress session with -cpstream ibm850 and configure your terminal to the encoding ibm850.

and If you don't wants to change the startup parameters you can change localy
SESSION:CPSTREAM = "ibm850".
or SESSION:CPPRINT = "ibm850".
 

msalva

New Member
I'm working in windows environment, i don't know if i have to configure the terminal or not.

runing with the -cpstream ibm850 the results is the same. :(


no no ... it work's very well your example, but you have to start your progress session with -cpstream ibm850 and configure your terminal to the encoding ibm850.
 

rstanciu

Member
SESSION:CPSTREAM = "ibm850" is only readable. I use it i the start parameter.

correct ! , on windows these charactès can not be displayed.

When I need to print something I create my report in HTML syntax and
I transform the HTML->PDF with a free tool "htmldoc", simple.
I don't known if this can help you, but is a way to get a quick result.

/* editionPDF.p */
/* Download HTMLDOC: http://www.htmldoc.org/software.php*/
DEFINE VARIABLE fileName AS CHARACTER NO-UNDO.
DEFINE STREAM ls.
fileName = "c:\tmp\report.html".
&SCOPED-DEFINE PRINT PUT STREAM ls UNFORMATTED
/************************************/
OUTPUT STREAM ls TO VALUE(fileName).
{&PRINT} "<HTML>" SKIP.
{&PRINT} "<TABLE border=1>" SKIP.
{&PRINT} "<TR>" SKIP.
{&PRINT} "<TH>CustNum</TH><TH>Name</TH><TH>Phone</TH>" SKIP.
{&PRINT} "</TR>" SKIP.
FOR EACH Customer NO-LOCK:
{&PRINT} "<TR>" SKIP.
{&PRINT} "<TD align=right bgColor=yellow>" +
STRING(Customer.CustNum) +
"</TD><TD>" + Customer.Name +
"</TD><TD>" + Customer.Phone +
"</TD>" SKIP.
{&PRINT} "</TR>" SKIP.
END.
{&PRINT} "</TABLE>" SKIP.
{&PRINT} "</HTML>" SKIP.
OUTPUT STREAM ls CLOSE.

OS-COMMAND SILENT(VALUE('"C:\Program Files\HTMLDOC\ghtmldoc.exe" -f c:\tmp\test.pdf ' +
'--webpage c:\tmp\report.html --size a4 ')).
OS-DELETE VALUE("c:\tmp\report.html").

/************************************/
 
Top