APEX 5 Saved Interactive Reports – Primary Report Name Change

I had a requirement today to use the Saved Reports feature of APEX to create a list of reports for users to pick from. The issue was with the default report name. We wanted the name to reflect what the report was designed for. Showing a label of “All Data” was mare appropriate for the default report rather than the given “1. Primary Report” label.


Messages and Translation

As with many things software, there is almost always more than one way to accomplish a result.

In Oracle, you can change most of the text options using translations. Oracle invests a lot of effort in supporting multi lingual implementations. If this is your situation also, I strongly recommend using the translation mechanic to change the default text. Even if you only develop in one language, you can leverage this capability.

Creating a Text Message with the value of APEXIR_PRIMARY_REPORT will change the listing for the “PRIMARY REPORT” label on ALL interactive reports across your application.


The value entered for the translation will apply to all interactive reports in your application


Change to different values per Interactive report

If your use case is to have the default report named differently on each interactive report instance, you have an option to adjust the listing using Dynamic Actions and a bit of JavaScript.

Create a dynamic action on the Interactive Report region – for the After Refresh event.

Add an execute JavaScript action.

The concept of the JavaScript is to locate the report list and re-name the un-translated APEX provided name to a custom value.

var my_primary_report_name = 'My Name of Choice';

$('#'+this.triggeringElement.id+' .a-IRR-selectList').find('option').each(function(index,elem){
    return text.replace('1. Primary Report',my_primary_report_name);
  }); // end of text change
}); // end of option walk

This JavaScript code executed in a Dynamic Action – can reference the REGION_ID, allowing each interactive report implementation to have a different name.



Full list of text replacements in Oracle Documnets
Inspiration and Similar Posts
Stack Overflow – Post with similar methodology for 4.2

3 thoughts on “APEX 5 Saved Interactive Reports – Primary Report Name Change

  1. Hello Tim,

    In the javascript code your report name is still hardcoded.
    If you create a shortcut in your Apex application as a “Message with Javascript escaped single quotes”, you can use it in Javascript together with the translatable Text message.

    For example:
    The shortcut is named MY_PRIMARY_REPORT_NAME_SC.

    In Javascript you can reference it like:
    var my_primary_report_name='”MY_PRIMARY_REPORT_NAME_SC”‘;
    Notice the double quotes!

    Finally create a text message called MY_PRIMARY_REPORT_NAME_SC for each language you need a report name.



  2. Mathieu,

    Thank you for your input. There are several ways to deal with the translations of static text. This is also a consideration with ANY saved public report.

  3. Tyvm for the info, helped me a lot! You can use this resouce for multilingual applications, so you can display several named reports at several languages.

    If you use some sort of flag for language-change, it’s more of a shure thing.

    You can use the above javascript on dynamic action, just use When – ‘Mouse Button Press’ – Selection type – ‘Region’ Region – ‘your_report_region’

    For multilanguage you must create one javascript for each language. If my report is named ‘prosciutto’ in italian, you create a Dynamic Action named prosciutto en-us for example. Use this javascript for the substitution, and then create another one named prosciutto ita-eu(just an example) to rename from english to italian.

    Most important, use Server Side Condition – ‘Current Language is Contained in Value’ – > en-us (or another language of some sort)

    This will activate each Dynamic Action pending the current selected language of the system. Hope it helps.

Leave a Reply

Your email address will not be published. Required fields are marked *