Forum Stats

  • 3,817,330 Users
  • 2,259,314 Discussions
  • 7,893,751 Comments

Discussions

APEX_DATA_EXPORT.ADD_HIGHLIGHT buggy behavior

Smuckers
Smuckers Member Posts: 46 Red Ribbon
edited Mar 25, 2021 7:48PM in APEX Discussions

I'm using the APEX_DATA_EXPORT package to export an interactive report to Excel. I can't create the highlights I need in the IR because of the way the cell-based conditions work. You can set Cell X to be highlighted when the value of Cell X meets a certain condition. However, you can't set Cell X to be highlighted when the value of Cell Y meets a certain condition. Therefore, in the on-screen report, I'm highlighting the cells using CSS. However, that highlighting gets lost when you export to Excel.

The APEX_DATA_EXPORT.ADD_HIGHLIGHT procedure does allow (in fact it essentially requires) that cell highlighting be defined by two fields rather than one. I set up the highlights for one of two columns that required them and everything worked perfectly. I then set up the highlights for the second column, which uses the same color logic, but the column data can be different. Everything looked good until I realized that in the cases where the data was different and the colors should be different, Column 2 had the same background color as column 1. I went through multiple iterations of hair-pulling verifying that I was looking a the right columns/etc. for the highlight values.

There are six ADD_HIGHLIGHT calls for the two columns. What appears to be happening is that once any call-level color is defined for a given row, any other cell-level highlight used in that row will utilize the first color. Immediately below are the six called to ADD_HIGHLIGHT. Below that is a screenshot of three different behaviors. The leftmost is what happens when the code in my export procedure matches the below exactly. The middle cell shows what happens when I commented out the first three ADD_HIGHLIGHT calls (i.e. the ones for the 'Initial Rating' column. The last shows what happened when I moved the three calls for the 'Current Rating' column above the three ADD_HIGHLIGHT calls for the 'Initial Rating' column in my export procedure.

Maybe I'm doing something really stupid that I'm just not seeing, but if so... I'm not seeing it.


 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 1,
   p_value_column    => 'INIT_RATING_HL',
   p_display_column   => 'INITIAL_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#FF0000');

 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 2,
   p_value_column    => 'INIT_RATING_HL',
   p_display_column   => 'INITIAL_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#FFFF00');

 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 3,
   p_value_column    => 'INIT_RATING_HL',
   p_display_column   => 'INITIAL_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#33CC33');

 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 4,
   p_value_column    => 'CUR_RATING_HL',
   p_display_column   => 'CURR_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#6666CC');

 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 5,
   p_value_column    => 'CUR_RATING_HL',
   p_display_column   => 'CURR_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#CC99FF');

 apex_data_export.add_highlight(
   p_highlights     => l_highlights,
   p_id         => 6,
   p_value_column    => 'CUR_RATING_HL',
   p_display_column   => 'CURR_RATING',
   p_text_color     => '#000000',
   p_background_color  => '#FF66FF');

   


Tagged:

Answers

  • Boersman
    Boersman Member Posts: 8 Blue Ribbon

    I think I have exactly the same issue with row level highlights in Apex 20.2.

    When I execute the same code in a free APEX.oracle.com workspace ( version 21.2 ) it works fine.

    Did you solve the problem or is it a bug that is fixed in a later version of APEX?