NF9 Column Display Type For Jasper Report
From iDempiere en
Feature: Use iDempiere Display/Reference Type In Jasper Report
Goal: Development
Feature Ticket: IDEMPIERE-4868 IDEMPIERE-6048
Description: Allow the use of iDempiere's Display/Reference Type based rendering of data in Jasper Report.
Usage:
- Pass COLUMN_LOOKUP parameter of type java.util.function.BiFunction to Jasper Report.
- To use it, you have to add a report parameter to your Jasper Report that's with the name and type above.
- In your field expression, you will then use expression of the format $P{COLUMN_LOOKUP}.apply("Display Type", Value).
- Value is usually a field reference (for e.g $F{C_DocType_ID}) but you can also use a string or number literal.
- "Display Type" can be one of the following:
- "TableName.ColumnName" - Get Display/Reference type from AD_Column (AD_Reference_ID and AD_Reference_Value_ID)
- Supported Type: Search, Table, TableDir, List, ChosenMultipleSelectionList, ChosenMultipleSelectionSearch, ChosenMultipleSelectionTable, Location, Image, YesNo, Account, Locator and PAttribute.
- In Release-10-2023-06-28 was added support for types Date and Numeric
- "location" - Address from C_Location.
- "account" - Description from Account Combination (C_ValidCombination)
- "locator" - Value from C_Locator
- "asi" - Description from M_AttributeSetInstance
- "AmtInWords" - Translate numeric Value to Wordings (i.e Msg.getAmtInWords)
- "Image" - get Image from AD_Image
- "YesNo"
- "chart/width/height" - width and height is numeric value for expected width and height in pixel. This render chart from AD_Chart as image.
- "attachment/table name/index" - index is index of attachment item (zero base). This get attachment item content as byte array (byte[]). NOTE: added on release-11-20240315
- "attachment/table name/file name" - file name can be exact or wildcard (*) matching of attachment item's file name (case sensitive). This get attachment item content as byte array (byte[]). NOTE: added on release-11-20240315
- "TableName.ColumnName" - Get Display/Reference type from AD_Column (AD_Reference_ID and AD_Reference_Value_ID)
Example:
- $P{COLUMN_LOOKUP}.apply( "c_order.c_bpartner_id", $F{c_bpartner_id} )
- $P{COLUMN_LOOKUP}.apply( "location", $F{ship_c_location_id} )
- $P{COLUMN_LOOKUP}.apply("c_bpartner_location.c_location_id",$F{c_location_id})
- $P{COLUMN_LOOKUP}.apply("c_bpartner.invoicerule",$F{invoicerule})
- $P{COLUMN_LOOKUP}.apply( "yesno", $F{isbillto} )
- $P{COLUMN_LOOKUP}.apply( "chart/600/400", 50002)
- $P{COLUMN_LOOKUP}.apply( "attachment/test/0", 103)
- $P{COLUMN_LOOKUP}.apply( "attachment/test/emoji*.png", 103)
Update:
- IDEMPIERE-6048 added support for attachment ("attachment/table name/index" or "attachment/table name/file name").