send report directly to printer on client side using webutil [message #414660] |
Thu, 23 July 2009 02:14 |
nasir_mughal
Messages: 122 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 #415503 is a reply to message #414862] |
Tue, 28 July 2009 02:06 |
nasir_mughal
Messages: 122 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
|
|
|