I need to print jasper report via network printer without showing printer dialog.And I used following code with printer name as a third parameter, but it gives an error : “Error Printing Report”.How do I solve this problem.Any help would be greatly appreciated.
plugins.jasperPluginRMI.jasperReport(forms.orders.controller.getServerName(),'barcodegenerator.jrxml',"HP Color LaserJet 2600n",'print',_params)
I need to print jasper report via network printer without showing printer dialog.And I used following code with printer name as a third parameter, but it gives an error : “Error Printing Report”.How do I solve this problem.Any help would be greatly appreciated.
plugins.jasperPluginRMI.jasperReport(forms.orders.controller.getServerName(),'barcodegenerator.jrxml',"HP Color LaserJet 2600n",'print',_params)
Thank You,
Aruna
Hi Aruna,
Use total Printer path(like \ServerName\hp officejet 4200 series) or use application.getPrinters() method to find list of printers.
Thanks for your reply “ars” and it was really helpful to me to know how to give exact path of the printer.
Now we have another issue ,our server is located in another country and we need to print a report using client side printer. In normal way we can access server side printers,but we cannot client side. Is there any way to access it.(The diagram I attached will give you an idea about the issue)
In our solution we have criteria to select printer automatically,then we need to send a report directly to a printer in client side as well.
Any help would be greatly appreciated.
You can get all the installed printers at the client side by using the application.getPrinters() method. It will return you a array of paths to the printers that are properly installed at client side.
I just tried several times with “application.getPrinters()” ,but it always gives server side printer names.To test it ,I remotely logged into our remote site and ran the solution which is in the local pc,then it was gave all the printers which are installed in the local pc.
I just tried several times with “application.getPrinters()” ,but it always gives server side printer names.To test it ,I remotely logged into our remote site and ran the solution which is in the local pc,then it was gave all the printers which are installed in the local pc.
Aruna
Hi Aruna,
I tried in our LAN and It is working perfectly. You are talking about accessing the client side installed printers over internet. Servoy uses Java Web Start Technology to deploy application over the network. It should access the installed printers at the client side.
we are using both web client and smart client.But “application.getPrinters()” method only works in smart client.Is there any other way to access client side printers in web client.
How do I fix this problem.
No, there is no way of accessing client printers in webclient, keep in mind that you’re running your solution inside a web browser. Why do you need to get the list of printers while running in webclient? If you simply call showPrintPreview() Servoy shows a popup with a PDF print of the form and then the user can decide if/where to print.
aruna:
we are using both web client and smart client.But “application.getPrinters()” method only works in smart client.Is there any other way to access client side printers in web client.
How do I fix this problem.
WebClient is in fact a (headless) Servoy client running on the server that sends the screen-output as pure HTML to the browser.
So you are bound to the ‘laws of the web’ now (and your browser). Does your browser support it to let a webpage (via inline javascript) choose a printer for you all by itself ? Can it load a page without viewing it and send it to a printer?
As you can see things are quite different than when you use a real local running application like Servoy rich-client.
What you can do however is make use of the server-side printing (to PDF) and downloading to webbrowser approach that WebClient offers.