Implement column lookup support for Jasper Report

Description

  1. Implement support for jasper report to lookup display text or image for the following display type:

    1. List

    2. Search, Table and Table Dir

    3. Location

    4. Locator

    5. Account Combination

    6. Attribute Set Instance

    7. Image. Expression syntax: $P{COLUMN_LOOKUP}.apply(“image”, $F{image_id})

    8. Multiple Selection List, Multiple Selection Search and Multiple Selection Table

    9. YesNo

    10. Amount in words. Expression syntax: $P{COLUMN_LOOKUP}.apply(“AmtInWords”, $F{GrandTotal})

    11. Chart. Expression syntax: $P{COLUMN_LOOKUP}.apply(“chart/width/height”, $F{chart_id}). Replace width and height with the actual width and height in pixel of the Chart Image.

  2. Report Starter will introduce a new parameter "COLUMN_LOOKUP" of type java.util.function.BiFunction

  3. To use this, add a new report parameter "COLUMN_LOOKUP" of type java.util.function.BiFunction to your jasper report.

  4. The BiFunction parameter is an interface that has a single method, apply that take two input argument. First argument is use to lookup the display type, typically of the "tablename.columnname" format string (except the image,amtinwords and chart display type above). Second argument take the report field value.

  5. E.g 1: $P{COLUMN_LOOKUP}.apply("c_bpartner.m_pricelist_id",$F{m_pricelist_id}) to get the display text for m_pricelist_id

  6. Eg 2: $P{COLUMN_LOOKUP}.apply("c_bpartner.invoicerule",$F{invoicerule}) to get display text for invoicerule

  7. Eg 3: $P{COLUMN_LOOKUP}.apply("c_bpartner_location.c_location_id",$F{c_location_id}) to get display text for an address

Environment

None

Attachments

2

Activity

Heng Sin Low 
July 6, 2021 at 8:33 AM

Example 2Pack for testing:

Pack in will add a new menu entry of “BPartner_Test_Landscape”

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created July 6, 2021 at 8:31 AM
Updated September 1, 2021 at 9:04 PM
Resolved July 19, 2021 at 9:27 AM