NF9 Column Display Type For Jasper Report

From iDempiere en

Feature: Use iDempiere Display/Reference Type In Jasper Report

Goal: Development

Developer: Hengsin (talk)

Feature Ticket: IDEMPIERE-4868 IDEMPIERE-6048

Description: Allow the use of iDempiere's Display/Reference Type based rendering of data in Jasper Report.

Usage:

  1. Pass COLUMN_LOOKUP parameter of type java.util.function.BiFunction to Jasper Report.
  2. To use it, you have to add a report parameter to your Jasper Report that's with the name and type above.
  3. In your field expression, you will then use expression of the format $P{COLUMN_LOOKUP}.apply("Display Type", Value).
  4. Value is usually a field reference (for e.g $F{C_DocType_ID}) but you can also use a string or number literal.
  5. "Display Type" can be one of the following:
    1. "TableName.ColumnName" - Get Display/Reference type from AD_Column (AD_Reference_ID and AD_Reference_Value_ID)
      1. Supported Type: Search, Table, TableDir, List, ChosenMultipleSelectionList, ChosenMultipleSelectionSearch, ChosenMultipleSelectionTable, Location, Image, YesNo, Account, Locator and PAttribute.
      2. In Release-10-2023-06-28 was added support for types Date and Numeric
    2. "location" - Address from C_Location.
    3. "account" - Description from Account Combination (C_ValidCombination)
    4. "locator" - Value from C_Locator
    5. "asi" - Description from M_AttributeSetInstance
    6. "AmtInWords" - Translate numeric Value to Wordings (i.e Msg.getAmtInWords)
    7. "Image" - get Image from AD_Image
    8. "YesNo"
    9. "chart/width/height" - width and height is numeric value for expected width and height in pixel. This render chart from AD_Chart as image.
    10. "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
    11. "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

Example:

  1. $P{COLUMN_LOOKUP}.apply( "c_order.c_bpartner_id", $F{c_bpartner_id} )
  2. $P{COLUMN_LOOKUP}.apply( "location", $F{ship_c_location_id} )
  3. $P{COLUMN_LOOKUP}.apply("c_bpartner_location.c_location_id",$F{c_location_id})
  4. $P{COLUMN_LOOKUP}.apply("c_bpartner.invoicerule",$F{invoicerule})
  5. $P{COLUMN_LOOKUP}.apply( "yesno", $F{isbillto} )
  6. $P{COLUMN_LOOKUP}.apply( "chart/600/400", 50002)
  7. $P{COLUMN_LOOKUP}.apply( "attachment/test/0", 103)
  8. $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").
Cookies help us deliver our services. By using our services, you agree to our use of cookies.