Home » Developer & Programmer » Forms » NEED HELP, developing a database in oracle form 6i
|
Re: NEED HELP, developing a database in oracle form 6i [message #547638 is a reply to message #547631] |
Thu, 15 March 2012 05:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
As far as I understood, this:
Quote:
through receipt printer, i want generate auto slip
is the requirement. Unfortunately, I have no idea what "through receipt printer" means. Is it an output device (you know, a "printer", such as HP 4350 or Epson LQ-870 and similar)?
"Generating an auto slip" is ... what? You want to create a report ("slip"?) that will be printed on the printer? If so, I'd use Reports Builder. But, what is "auto slip"?
Could you describe it once again, providing some more details?
|
|
|
|
Re: NEED HELP, developing a database in oracle form 6i [message #547750 is a reply to message #547721] |
Fri, 16 March 2012 04:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
First part is easy (enter some values, save them into the database).
The second part is kind of tricky; it would be piece of cake if you'd create a "normal" report (such as PDF), open it, select "Print" and actually print it. However, cases like yours require a different approach - users usually don't want to view the report, but want it out, on the printer, as soon as possible.
I've done that years ago with Forms 3.0 on OpenVMS, where the output was sent - in character mode - directly to a printer. Unfortunately, I wouldn't know how to do the same on "modern" operating systems (which one do you use, anyway?). If it is of any help to you, here's the code I used; it utilized HOST built-in which called the operating system script (PRINT_SLIP) that printed certain information (payment_id, customer_code, ...).
I modified the original code a little bit (translation to English, removed certain parts), but the majority is still here.
host('@print_slip ' ||
to_char(:unos.payment_id, '990') || ' ' ||
:unos.customer_code || ' ' ||
translate(to_char(:unos.how_much_money, '99,990.00'), ',.', '.,') || ' ' ||
to_char(:unos.datum, 'dd.mm.yyyy.')
no_screen
);
The PRINT_SLIP script used escape sequences (set the printer controller mode ON, wrote values onto the standard output (printer, in this case), turned the printer controller mode OFF at the end. I'm not sure you'd benefit from OpenVMS script, but ... here you are:
$ ! Print slip on COMPUPRINT MDP 40 B
$
$ ! <ESC>[5i - Printer controller mode ON
$ ! <ESC>[4i - Printer controller mode OFF
$ ! <ESC>[4m - Underline
$ ! <ESC>[0m - All attributes off
$ !
$ cls
$ write sys$output "<ESC>[2;2H <ESC>[1mMy Company" + P4 + "<ESC>[0m"
$
$ set term/past
$
$ write sys$output "<ESC>[5i"
$ write sys$output " "
$ write sys$output " " + "*" + P3 + "kn" + "#" + P1
$ write sys$output " " + P2 + " - " + P4
$ write sys$output "<ESC>[4i"
$
$ set term/nopast
Hopefully, someone else will be able to assist better than I do.
|
|
|
Goto Forum:
Current Time: Fri Sep 06 17:10:44 CDT 2024
|