Multi print out document with Jasper for multi company implementation

292 views
Skip to first unread message

Mohamad Iqbal

unread,
Aug 31, 2021, 11:35:12 PM8/31/21
to iDempiere
Hi Everyone,

Currently we are implementing multi company with different print out document format for PO, Invoice, etc. for each company.

Here's what we've tried:
1. Create a different jasper report for each company, for example PO-1.jrxml & PO-2.jrxml, with each dataset hardcoded into its own AD_Client_ID.
2. Change the property report When No Data Type = No Pages so that when jasper company 1 is run in company 2 the result is No Pages (tested in Jaspersoft Studio, the preview result is Document is Empty)
3. Register both jasper jrxml in one Report & Process using this feature (https://idempiere.atlassian.net/browse/IDEMPIERE-3520).

What we hope for when executed, the two jrxmls will be processed and the results will only display 1 page for active clients and the jrxml for other companies will not be processed because of the condition When No Data Type = No Pages.
But the result is still 2 pages: 1 page for active company and 1 blank page for other company.

Is there a step missing here? 
Or is there a better way to accommodate this request?

Thank you for your help.

Heng Sin Low

unread,
Aug 31, 2021, 11:57:32 PM8/31/21
to idem...@googlegroups.com
The natural way should be to attached individual jasper report process to doc type > print format. Are you just trying to avoid the need to create an individual jasper process for each client/tenant ?

--
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/2169de95-6d59-4fba-ae11-6966f26ce8can%40googlegroups.com.

Mohamad Iqbal

unread,
Sep 1, 2021, 1:06:09 AM9/1/21
to iDempiere
I am trying to create two different jasper because each client/tenant has its own print out layout and both jasper will be attached to one process that will attached to the same menu.
So I register both jrxml in the same Report & Process with expectation that only 1 jrxml will be displayed because the other one has no data due to hard coded AD_Client_ID.

Screenshot_1.png

The first page supposed not to be displayed because it has no data (in its dataset query is harcoded with ad_client_id for other client/tenant) and its report property is set to When No Data Type = No Pages.

Thank you.

Heng Sin Low

unread,
Sep 1, 2021, 1:29:22 AM9/1/21
to idem...@googlegroups.com
a possible approach is 
- create process p1 for a dummy report view, rv1
- create menu item for p1
- create jasper report process for each tenant
- at each tenant, create print format for rv1, set the print format's jasper report process field to the process that hold the tenant specific jasper report layout

Martin Schönbeck

unread,
Sep 1, 2021, 5:09:08 PM9/1/21
to iDempiere
Hi,

perhaps check out our plugin https://wiki.idempiere.org/en/Plugin:_Beluga_Serverprint which allows much more than what you need. I suggest even than to create a separate process for each report but you could also use the field 'report variant' to differentiate between the versions.

Regards
Martin

Mohamad Iqbal

unread,
Sep 1, 2021, 11:13:08 PM9/1/21
to iDempiere
Thank you Hengsin, we've tried it and it works like a charm.

Martin, definitely we should try your plugin. Thank you for your contribution.

Regards,
Iqbal

Reply all
Reply to author
Forward
0 new messages