Help: Sending output directly to printer [message #7265] |
Fri, 30 May 2003 21:28 |
ash
Messages: 43 Registered: February 2001
|
Member |
|
|
Hi, is there anyone here who has tried sending an output directly to a printer(dot mtrx)?
lets say, i have an invoicing app created in Forms 5/6i i need to print the invoice data directly since were using a custom sized paper and using the Report builder is not practical coz u dont neet to preview your output anymore...
i appreciate your feedback.. thanks
|
|
|
|
Re: Help: Sending output directly to printer [message #7293 is a reply to message #7281] |
Mon, 02 June 2003 20:05 |
ash
Messages: 43 Registered: February 2001
|
Member |
|
|
Hi MHE, still need your expertise here.
the follwing VB code was used to print an invoice directly to the printer using the printer object:
Printer.FontName = "Courier New"
Printer.FontSize = 8
Printer.Print
Printer.Print
Printer.Print Space(1); txtCPer.Text
Printer.Print
Printer.Print Space(1); txtCusName & " - " & txtCusCode
Printer.Print
Printer.Print Space(1); txtCusAddr.Text
Printer.Print
Printer.Print Space(1); txtAd2.Text
Printer.Print
Printer.Print Space(35); sTel1
Printer.Print Space(35); Stel2
Printer.Print Space(35); MyUserName & " " & UCase(Format(Now, "DD-MMM-YY"))
Printer.NewPage
Printer.EndDoc
--Question:
Can we possibly transform this code into a Forms compatible approach using the HOST you've told me?
Im not familiar with the host command...
thanks in advance,
ASh
|
|
|
Re: Help: Sending output directly to printer [message #7312 is a reply to message #7293] |
Wed, 04 June 2003 01:01 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
HOST(command VARCHAR2) is the *Forms* built-in that accepts a string and passes this string to the client's OS and the OS executes it literally.
There's another built-in, called WINEXEC, but that requires the D2KWUTIL.PLL library (This can be found somewhere on your. $ORACLE_HOME$ directory).
With the TEXT_IO built-in, you can create files.
With the PRINT built-in, you print the current window to a file.
If I were you, I would create a Report and call that from Forms. You can redirect it to a printer. It is nice and clean (no messy code or tricks).
MHE
|
|
|