Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I'm so glad I found this site... Now I can get some sleep, because my problem is solved..."

Geography

Where in the world do Tek-Tips members come from?

Changing Font Size, Type and etc. while printing the document

AhmetSinav (IS/IT--Management)
24 Apr 06 11:41
OpenEdge 10.1B.
Hi,
i can change font via the following code,
PROCEDURE runPrintTest:
    OUTPUT TO printer.
    MESSAGE "This is a test".
    OUTPUT CLOSE.
END PROCEDURE.
RUN runPrintTest.

LOAD "SOFTWARE\PSC\PROGRESS\10.1B\" BASE-KEY "HKEY_CURRENT_USER".
/* Set PrinterFont */
PUT-KEY-VALUE SECTION "Startup" KEY "PrinterFont" VALUE "Courier New, size=8, bold".
USE "SOFTWARE\PSC\PROGRESS\10.1B\".

/* Use new PrinterFont setting */
RUN runPrintTest.

i want to set more fonts to my document. for example i want to make the headers bold and the data's is not bold.
/* headers */
Customer No   Customer Name /* this font will be Bold */
/* datas */
1             blalalala     /* this font will be Normal */
Best Regards.
MadMichael (Programmer)
24 Apr 06 17:49
First, determine the control codes which your printer understands. HP and compatible printers use PCL, your mileage may vary.

Then use the 'PUT CONTROL' statement within your procedure to output the control codes and set font characteristics as desired. You may do other formatting with PCL, such as landscape orientation, registration adjustment to fit pre-printed forms, and so forth.

For your specific example of bold headers and normal body text, you will probably want to use the PUT statement for both headers and data, as opposed to DISPLAY which automatically generates the column headers by default.
AhmetSinav (IS/IT--Management)
28 Apr 06 8:21
Hi;
 Thanks for your answer. Can u send me an example about this?
Best Regards.
MadMichael (Programmer)
28 Apr 06 12:06
Step 0 is the PCL code. Here is a PCL reference page:
http://www.nefec.org/UPM/ccPCLfrm.htm

If your printer does not understand PCL, you will need to determine from your printer's documentation what codes to use.

Note the code for BOLD is 'Esc(s3B',
and the code for NORMAL is 'Esc(s0B'.

Since the 'ESC' (escape) character is non-printing, it must be generated with the CHR function. An ascii reference page, http://jimprice.com/ascii-0-127.gif , shows that 'ESC' is equivalent to decimal 27.

Now we have enough information to build the control strings. Here is the code (I am printing to a HP Deskjet printer):

CODE

/* print control demo 04/28/06 */

/* define variables to hold the control codes */
DEF VAR v-bold AS CHARACTER.
DEF VAR v-normal AS CHARACTER.

/* set the control codes */
v-bold = CHR(27) + "(s3B".
v-normal = CHR(27) + "(s0B".

OUTPUT TO PRINTER.

PUT CONTROL v-bold.

PUT "This is BOLD print." SKIP.

PUT CONTROL v-normal.

PUT "This is normal print." SKIP.

OUTPUT CLOSE.

When using PUT in this manner for a formal report, you will need to take explicit control of all aspects of your printed output, i.e. use the LINE-COUNTER function to determine when page-breaks are appropriate, use the PAGE statement to insert those page breaks, and construct and PUT your own page and column headers.

AhmetSinav (IS/IT--Management)
2 May 06 2:42
Thanks for your helps.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close