Home » SQL & PL/SQL » SQL & PL/SQL » Help: Sending output directly to printer
Help: Sending output directly to printer [message #7265] Fri, 30 May 2003 21:28 Go to next message
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 #7281 is a reply to message #7265] Mon, 02 June 2003 04:26 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
1.In Reports, you can send the output directly to a printer. Just change the destination_type.

2.You could spool a flat file and via 'HOST' redirect it via OS commands to the printer.

MHE
Re: Help: Sending output directly to printer [message #7293 is a reply to message #7281] Mon, 02 June 2003 20:05 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: How to add a row counter while retriving the records
Next Topic: Packages in sys user.
Goto Forum:
  


Current Time: Fri Apr 26 15:23:53 CDT 2024