NF9.1 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

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. "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.

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)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.