How can we skip the print preview (direct printing) from Java with Idempiere (Web)

922 views
Skip to first unread message

Pedro Rozo

unread,
Aug 25, 2014, 11:26:08 AM8/25/14
to idem...@googlegroups.com
Hi everyone

Within the upcoming SmartPOS Web 3.0 We want to have a quick print option, then do not want to preview all the invoices before printing, 

1. We have seen some old preferences (desktop - swing version), but how we can skip the preview within Idempiere (web) ? for print formats like invoices and so on ? is it a global sys config ?

2. Currently after a sale if performed we create a new invoice and  we open it using the method: AEnv.zoom(AD_Window_ID, query); but  is there any option to print directly the invoice from java without open the invoice window, preview and then print ? 

Regards

Pedro Rozo.






norber...@multimageweb.com

unread,
Aug 26, 2014, 8:11:07 AM8/26/14
to idem...@googlegroups.com
hi Pedro,

do you want print locally or to remote printer ? We are differentiate when:

1. User Print pdf preview then print it from browser (using browser or OS dialog select printer)
2. Print to linux CUPS - print to server CUPS queue being routed to the right printer (i prefer this, not yet fully implemented now)
3. print directly to remote IP address  (contra: if printer not available then browser session able to break)

that is how we are using print to printers. if you interested we can share code too.
hope help.
n

This e-mail is confidential and may contain legally privileged information. It is intended only for the addressees and may not be reviewed or used in any way by other recipients. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message and any attachments thereto from your system.

Pedro Rozo

unread,
Aug 26, 2014, 8:25:43 AM8/26/14
to idem...@googlegroups.com
Hi Norbert.

Thanks for your quick feedback, we want to print locally for now (browser) minimizing the number of mouse clicks for the end user: we are generating the new invoice from java so we should be able to call any logic from the idempiere API, any suggestions , is there any idempiere java class to print an invoice directly without a preview or without opening the invoice first?

Regards.

Pedro R

hie...@hasuvimex.vn

unread,
Aug 26, 2014, 10:30:29 AM8/26/14
to idem...@googlegroups.com
Pedro, can view some link.



Sent from my BlackBerry 10 smartphone.
From: Pedro Rozo
Sent: Tuesday, August 26, 2014 19:25
Subject: [idempiere] Re: How can we skip the print preview (direct printing) from Java with Idempiere (Web)

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/3fbb2d6c-fd32-423f-8117-00e16475ca0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pedro Rozo

unread,
Aug 26, 2014, 10:36:03 AM8/26/14
to idem...@googlegroups.com
Hi Hiep.

Thanks for your comments, but I am not working wiht jasper reports, just using regular print formats .. and both links provided are for jasper & custom reports ... 

Do you know if there any simple java api method to trigger the printing for print formats ?

Regards,

Pedro R

hie...@hasuvimex.vn

unread,
Aug 26, 2014, 10:51:36 AM8/26/14
to idem...@googlegroups.com
Pedro.
My opinion. Regular report and jasper report is different at create report file (pdf, csv,...)‎.
Solution for direct print can is same.

Sent from my BlackBerry 10 smartphone.
From: Pedro Rozo
Sent: Tuesday, August 26, 2014 21:36
Subject: Re: [idempiere] Re: How can we skip the print preview (direct printing) from Java with Idempiere (Web)

Fco. Javier Vannini Robelo

unread,
Aug 26, 2014, 3:11:49 PM8/26/14
to idem...@googlegroups.com
Hey Pedro, Like throwing a blind dart maybe I hit the mark with this link:

http://forum.zkoss.org/question/44655/print-documents-without-show-the-content/?sort=oldest&page=2#sort-top

In this thread they give code for such function and the result of such code can be seen in the following website if you press the button labeled "Drucken"

http://online.odoerfer.com/OdKatalog/tree.zul#pi_30238



Pedro Rozo

unread,
Aug 26, 2014, 5:59:46 PM8/26/14
to idem...@googlegroups.com
Francisco.,

Please notice we are just looking an Idempiere API method/class to perform that printing task for print format, we are not looking any advanced zk code/html/javascript tricks for printing.      

Regards

Pedro R.

Dirk Niemeyer

unread,
Aug 27, 2014, 3:54:14 AM8/27/14
to idem...@googlegroups.com
Hi Pedro,

in the swing ui you can set "Always preview print" in the user
preferences. Depending on this setting a click on the printer icon of a
window either shows the preview or prints directly.

Not sure how this is done in web client as this does not show up in
preferences.

For a report you can check the selection "Direct Print" in the process &
report window to enable "Print without dialog".

You may search the sources for IsDirectPrint to find out how this works.

Regards,

Dirk Niemeyer

Am 26.08.2014 23:59, schrieb Pedro Rozo:
> Francisco.,
>
> Please notice we are just looking an Idempiere API method/class to perform
> that printing task for print format, we are not looking any advanced zk
> code/html/javascript tricks for printing.
>
> Regards
>
> Pedro R.
>
> El martes, 26 de agosto de 2014 14:11:49 UTC-5, FJVR escribió:
>>
>> Hey Pedro, Like throwing a blind dart maybe I hit the mark with this link:
>>
>>
>> http://forum.zkoss.org/question/44655/print-documents-without-show-the-content/?sort=oldest&page=2#sort-top
>>
>> In this thread they give code for such function and the result of such
>> code can be seen in the following website if you press the button labeled
>> "Drucken"
>>
>> http://online.odoerfer.com/OdKatalog/tree.zul#pi_30238
>>
>>
>>
>> 2014-08-26 7:51 GMT-07:00 <hie...@hasuvimex.vn <javascript:>>:
>>
>>> Pedro.
>>> My opinion. Regular report and jasper report is different at create
>>> report file (pdf, csv,...)‎.
>>> Solution for direct print can is same.
>>>
>>> Sent from my BlackBerry 10 smartphone.
>>> *From: *Pedro Rozo
>>> *Sent: *Tuesday, August 26, 2014 21:36
>>> *To: *idem...@googlegroups.com <javascript:>
>>> *Reply To: *idem...@googlegroups.com <javascript:>
>>> *Subject: *Re: [idempiere] Re: How can we skip the print preview (direct
>>> printing) from Java with Idempiere (Web)
>>>
>>> Hi Hiep.
>>>
>>> Thanks for your comments, but I am not working wiht jasper reports, just
>>> using regular print formats .. and both links provided are for jasper &
>>> custom reports ...
>>>
>>> Do you know if there any simple java api method to trigger the printing
>>> for print formats ?
>>>
>>> Regards,
>>>
>>> Pedro R
>>>
>>> El martes, 26 de agosto de 2014 09:30:29 UTC-5, Hiep Lq escribió:
>>>>
>>>> Pedro, can view some link.
>>>>
>>>> https://groups.google.com/forum/m/#!topic/idempiere/YqF39E7CxgQ
>>>>
>>>> ‎http://wiki.idempiere.org/en/JasperReportsFreiBier#direct_
>>>> print.2C_automatic_archiving.2C_etc.
>>>>
>>>> Sent from my BlackBerry 10 smartphone.
>>>> *From: *Pedro Rozo
>>>> *Sent: *Tuesday, August 26, 2014 19:25
>>>> *To: *idem...@googlegroups.com
>>>> *Reply To: *idem...@googlegroups.com
>>>> *Subject: *[idempiere] Re: How can we skip the print preview (direct
>>>> <https://groups.google.com/d/msgid/idempiere/3fbb2d6c-fd32-423f-8117-00e16475ca0b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "iDempiere" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to idempiere+...@googlegroups.com <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/idempiere/cb9d820e-a185-401e-9e00-0a97fb364a1e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/idempiere/cb9d820e-a185-401e-9e00-0a97fb364a1e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "iDempiere" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to idempiere+...@googlegroups.com <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/idempiere/20140826145125.5374085.28695.1347%40hasuvimex.vn
>>> <https://groups.google.com/d/msgid/idempiere/20140826145125.5374085.28695.1347%40hasuvimex.vn?utm_medium=email&utm_source=footer>
>>> .

Pedro Rozo

unread,
Aug 27, 2014, 8:22:03 AM8/27/14
to idem...@googlegroups.com
Hi Dirk.

I am looking something similar for the web client, but just for regular print formats ...     (Neither jasper report, nor custom reports)

Perhaps HenSin or someone else with Idempiere core knowledge could guide us .?.. I guess there should be a sysconfig or just a java API method to trigger a print format printing without the preview or just to trigger the print format printing without open


Pedro R

Jan Thielemann

unread,
Aug 28, 2014, 12:45:32 PM8/28/14
to idem...@googlegroups.com
As far as i know, direct printing from the webui is not possible because it runs in your browser and it would be dangerous if your browser could print documents without user interaction. Bad people could do nasty things if it were possible. 

However, maybe another approach could be used. You could generate the pdf on the server (e. g. in a process), copy the pdf to a special directory on the server and use functions of the operating system (e. g. cron jobs) to print all documents from the special directory.

If you find another way, let us know :)

Pedro Rozo

unread,
Aug 28, 2014, 1:23:54 PM8/28/14
to idem...@googlegroups.com
Hi Jan.

Thanks for your feedback, two quick questions.

1. Do you know if  is it possible to disable the normal preview for regular print formats ? similar to the direct print for jasper reports ? (webui) 
2. To use the process approach to generate the PDF in the background do you have any examples/thread to analize ?

Regards

Pedro R

armenrz

unread,
Aug 28, 2014, 10:21:42 PM8/28/14
to idem...@googlegroups.com
Hi Pedro,

The other way is to create an applet like Hengsin's sample in printing shipment label.

Unfortunately, I have tried similar thing but not succeed yet. It doesn't have error but it still won't print. So I can not give you any good advice right now.

Regards,

Armen

Heng Sin Low

unread,
Aug 28, 2014, 11:08:48 PM8/28/14
to idem...@googlegroups.com
I haven't try this, but perhaps https://developers.google.com/cloud-print/docs/gadget is another option that might work for this.


Pedro Rozo

unread,
Aug 29, 2014, 7:01:52 AM8/29/14
to idem...@googlegroups.com
Thanks Hengsin but we are trying to keep the implementation as simple/clean as possible (ideally just java code). .Having in midn that we just want to reduce the number of mouse clicks to generate an order.... is there any other option within the Idempiere API to skip at least the preview for print formats within the WEB UI (perhaps a sysconfig )?  or do you have any java code/thread suggestion where we can find a print format printing process with pure java as Jan mentioned before?

Regards

Pedro R.
Reply all
Reply to author
Forward
0 new messages