設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 983|回復: 0
打印 上一主題 下一主題

Ascii Printing Codes <INFORMIX-4GL>

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2016-6-10 11:31:35 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
As most replies have already indicated, Informix doesn't make printing easy;
however, it's not all that difficult, either. You will need to do a little research, but if you have the necessary user manuals for the printers you want to use, setting up your printer codes is relatively easy. What you'll need to do is define some character-type variables to represent the printer codes you want to work with:
i.e.; bold on, underline on, underline off,landscape, portrait, etc.
Don't forget to include a variable for the reset codes as well, so you can return the printer to it's internally programmed default setup when your report is finished.
The size of each character variable will be dependent upon the number of characters required for each printer code used; again, per your printer's usual manual.
These are generally best defined in the report function, since they're not likely to
be used elsewhere in your program. Once the variables are assigned and the appropriate codes have been assigned,
simply sent the codes to the printer using the report function's 'print' statement, as they are required.


The following example is for an H-P LaserJet 4:


REPORT BALANCE_SHEET()
DEFINE l_bold_on char(05), { Bold on }
l_normal char(06), { Normal }
l_ul_on char(05), { Underline on }
l_ul_off char(04), { Underline off }
l_lscape char(05), { Landscape orientation }
l_reset char(02) { Printer reset }

FORMAT
PAGE HEADER
LET l_bold_on = ascii 027, ascii 040, ascii 115,ascii 051, ascii 066
LET l_normal = ascii 027, ascii 040, ascii 115,Ascii 045, ascii 051. ascii 066
LET l_ul_on = ascii 027, ascii 038, ascii 100,Ascii 048, ascii 069
LET l_ul_off = ascii 027, ascii 038, ascii 100,ascii 064
LET l_lscape = ascii 027, ascii 038, ascii 108,Ascii 049, ascii 079
LET l_reset = ascii 027, ascii 069
PRINT COLUMN 1, l_landscape, l_bold_on, l_ul_on,"COMPANY NAME", l_ul_off, l_normal
ON EVERY ROW
PRINT COLUMN... (report data)
ON LAST ROW
PRINT COLUMN 1, l_reset
END REPORT

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-16 22:07 , Processed in 0.209904 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表