ReportEngine

111 views
Skip to first unread message

Flo Boj

unread,
Jul 14, 2022, 10:58:58 AM7/14/22
to iDempiere
Hello !
Problem : inside my ReportEngine - View I have(need) TWO C_Order_IDs,
PurchaseOrder : li_order_id
SalesOrder: c_order_id
.

Therefore, inside DataEngine.java,
in case ColumnName equals "liorder_id" I go :

                            eSql ="SELECT NVL(C_Order.DocumentNo,'-1') ||'_'|| NVL(C_Order.POReference,'-1') FROM C_Order WHERE ueit_termine.liorder_id=C_Order.C_Order_ID";
                            ColumnName = "C_Order_ID";
      
which, with respect to "Order Fields" either yields

Sales Order : 406999 ( which is the correct Sales Order Documentno)
Purchase Order: 406999

OR
Sales Order : 202222
Purchase Order: 202222 (which is the correct Sales Order Documentno).

Dear Carlos, since this block begins with 
 /* (IsParent && DisplayType.isLookup(AD_Reference_ID)) || <-- IDEMPIERE-71 Carlos Ruiz - globalqss */  , I like to ask you directly here !

Question 1:
Do you have an idea, on how to really separate those 2 colums
(that is customizing class 
org.adempiere.base/src/org/compiere/print/DataEngine.java
 a bit more) ?

Question 2:
Maybe theres an easy way to push TWO C_Order_ID, C_Orderline_ID ....
inside a single ReportEngine View ?


I hope for your patience with this my ugly problem, 
and wish you all good health !

Best Regards
Florian




 




Flo Boj

unread,
Jul 14, 2022, 11:02:38 AM7/14/22
to iDempiere
PS : Purpose here is to get both columns with the correct underline LINK directly into the related transaction !

Anozi Mada

unread,
Jul 14, 2022, 10:15:40 PM7/14/22
to iDempiere
I don't really understand about your first post but assuming you want the li_order_id to link into the correct transaction and window you can follow these steps:

Open menu Reference in system and create a new record: Name='Purchase Order', Validation Type=Table Validation.
Next in tab Table Validation: Table=C_Order, Key Column=C_Order_ID, Display Column=DocumentNo, Window=Purchase Order.
Open you li_order_id in Table and Column, set the Reference to Search and then set the Reference Key to the newly created reference (Purchase Order).

Regards,
Anozi Mada

Flo Boj

unread,
Jul 15, 2022, 5:57:17 AM7/15/22
to iDempiere
Hello Anozi Mada !
Yes, your idea made my status progress !
Inside my view (table) I gave li_order_id a Reference like you suggested. 
Still the "underscore" link doesnt appear.
Then inside Table Validation I chose to "Display Value : Yes" 
and inside DataEngine.java therefore
inside (Stringbuilder) sqlSELECT I needed to replace "C_Order.Value||'-'||" with "", 

but still the underscore link to the related transaction does not appear inside the ReportEngine - table.

I appreciate your help very much indeed,

best Regards
Florian

Anozi Mada

unread,
Jul 15, 2022, 10:07:20 AM7/15/22
to iDempiere
The column displayed separated by underscore is possible only if the columnname and tablename follow the rules (e.g. C_Order_ID and C_Order)
If the display arrangement is fixed (because you can actually arrange it with identifier checkbox at Column), maybe the workaround is add new virtual column for C_Order and declare how you want it to be displayed then set it as Display Column in Table Validation, I haven't tried that though.
But I can't help you if you want to change the core code.

Anozi Mada

unread,
Jul 15, 2022, 10:15:46 AM7/15/22
to iDempiere
But I think it's a good feature request: Make the Display Column in Table Validation not mandatory and if it's blank then use table identifiers instead.

Carlos Antonio Ruiz Gomez

unread,
Jul 16, 2022, 7:54:39 AM7/16/22
to idem...@googlegroups.com
Hi Anozi,

When researching IDEMPIERE-4448 I found that setting the reference same as the ID column it makes what you're requesting here.

I wrote that note in the ticket and changed 188 references in core to use that feature.

Regards,

Carlos Ruiz



El 15/7/22 a las 16:15, Anozi Mada escribió:

Anozi Mada

unread,
Jul 16, 2022, 8:19:01 AM7/16/22
to iDempiere
That's great! I never know that behaviour.
So that will solve the issue here.

Flo Boj

unread,
Jul 28, 2022, 8:30:22 AM7/28/22
to iDempiere
Hello !
In my code the following changes helped me (successfully here at my companies branch at least)
to get multiple "C_Order_ID, "LI_Order_ID" (titled DocumentNo..) etc to run with expected link to the expected transaction directly :

Inside
org.adempiere.base/src/org/compiere/print/DataEngine.java

 (linenumbers may very from main checkout branch, bcause I got MANY changes here ) :
953c947
<                         if (pdc.getColumnName().toUpperCase().endsWith("_ID")) // UEIT puts toupper
--
984c978
<                             if (pdc.getColumnName().toUpperCase().endsWith("_ID")) // ueit puts toupper
--
1082c1073
<                                 if (pde.getColumnName().toUpperCase().endsWith("_ID") && extension != null && !isExport) // ueit puts toUpper !


In my case, its because my pgAdmin just changes my "LI_Order_ID" inside my view to "li_order_id" . then DataEngine doesnt get it ..

Hope that helps

Best Regards
Florian

Anozi Mada

unread,
Jul 28, 2022, 9:51:06 AM7/28/22
to iDempiere
Based on Carlos information, you can basically just follow the solution on my first reply and set the Display Column = C_Order_ID instead and it will solve your issue.
No need to change the code.
Reply all
Reply to author
Forward
0 new messages