Home » Developer & Programmer » Forms » send report directly to printer on client side using webutil (application server 10.1.2.0.2, windows 2003 server R2)
send report directly to printer on client side using webutil [message #414660] Thu, 23 July 2009 02:14 Go to next message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
Hi

Here is the code i am using to run report.

WEB.show_document('/reports/rwservlet?server='||:PARAMETER.reps
		  	||'&ssoconn=default/oracledb/userid'
               		||'&report=daily_recv.rep'
                        ||'&desformat=PDF'
               		||'&destype=CACHE'
			||'&pyear='||:PARAMETER.fyear
			||'&branch='||:PARAMETER.branch_id
			||'&trans_date='||:inputs.end_date
			,'_blank');



I have configured Webutil on application server and its working.

I need code to display windows default printer selecting API on client's computer and send report directly to the selected printer .

I have searched a lot but found nothing like this.

Kindly help me.

Thanks.
Re: send report directly to printer on client side using webutil [message #414862 is a reply to message #414660] Thu, 23 July 2009 20:13 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Search this forum and google for 'win_api_dialog.select_printer'.

See http://www.orafaq.com/forum/t/147603/67467/

David
Re: send report directly to printer on client side using webutil [message #415503 is a reply to message #414862] Tue, 28 July 2009 02:06 Go to previous message
nasir_mughal
Messages: 121
Registered: April 2007
Location: Karachi
Senior Member
I found this java code at following link, But i am not familiar with java, so don't have idea where to put this code?

http://forums.oracle.com/forums/thread.jspa?threadID=419723


import java.awt.Frame;
import java.awt.JobAttributes;
import java.awt.PrintJob;
import java.awt.Toolkit;
import javax.swing.JPanel;
import java.io.*;
import oracle.forms.ui.VBean;

public class Select_Printer extends VBean {
public Select_Printer()
{
super();
}

public String getPrinterName()
{
String PrinterName=null;
JobAttributes jobAttributes;
try{
jobAttributes = new JobAttributes();
jobAttributes.setDialog(JobAttributes.DialogType.NATIVE);

Frame dummyFrame = new Frame();
PrintJob pJobDialog = Toolkit.getDefaultToolkit().getPrintJob(
dummyFrame, "Printtest", jobAttributes, null);
PrinterName = jobAttributes.getPrinter();
} catch (Exception e) {
System.out.println("Printer error!");
}
return PrinterName;
}

public static void main(String[] args)
{
Select_Printer select_Printer = new Select_Printer();
System.out.println(select_Printer.getPrinterName() );
}


}



Kindly help me. How to use it?

Thanks

Previous Topic: how to create list item from query
Next Topic: FRM-40514: Operation requires a database connection.
Goto Forum:
  


Current Time: Thu Dec 08 16:39:16 CST 2016

Total time taken to generate the page: 0.25495 seconds