🚀 Implementing Dynamic Report in Oracle APEX (Classic Report)

🚩Introduction 

  • In real-world Oracle APEX applications, report structures are rarely static. Business requirements often demand reports where columns change dynamically based on user selection, metadata configuration, or underlying data. Hardcoding columns in Classic Reports quickly becomes unmanageable and limits scalability.
  • To solve this challenge, Oracle APEX allows us to implement Dynamic Reporting using Classic Reports by generating SQL queries and column definitions at runtime. This blog explains how to design such a solution and why it is valuable in enterprise applications.

📑 Why Dynamic Reports Are Needed

Traditional Classic Reports work well when the column structure is fixed. However, dynamic reports are essential when:

  • Column names come from configuration tables

  • Data is pivoted dynamically

  • Users select which attributes to display

  • Reports are metadata-driven

  • Report layouts differ per role or module

Dynamic reporting ensures flexibility, maintainability, and better adaptability to changing business needs.

👉 Steps to create Dynamic Report

Dynamic Reports can be achieved in the Oracle APEX using the Classic Report, So we will be using the classic report in this tutorial to create the dynamic report.

Step 1: 

In the page designer, create one page item of type select one / select list and under the list of values give some static values like one , two , three.



Step 2: 

Now, create one region and select the type as Classic Report. 

Step 3: 

Select the Classic Report source as Function Body Returning Sql Query and paste this below code and select the page item which is created in the above step in the page items to return.

Step 4: 

In the Classic Report properties,under the source section, you will find the option Use Generic Column Names, check the check box and enter the generic column count in numerical value (ex: 10).



Mininum Value : 1 and Maximum value : 999

Step 5: 

create the dynamic action for the page item and select the event type as change and in the true action select refresh and the selection type as region and select the classic report which was created in the above step.

Step 6:

Now save the page and run the application, you will see the select list with report. when you select any value from that select list, then the report will be automatically refreshed with number of columns you selected. 



 
You can watch the live demo in my youtube channel 👉 Thanigai Solutions

🔥 Conclusion

Thus the Dynamic Reporting in the Oracle APEX can be achieved using the classic report by using the native properties without any plugins. This dynamic reporting in Oracle APEX using Classic Reports provides a powerful mechanism to build flexible, enterprise-ready applications. By leveraging PL/SQL and metadata-driven design, developers can eliminate rigid report structures and deliver highly adaptable reporting solutions. This approach not only improves maintainability but also enhances the overall user experience.

Comments

Popular posts from this blog

💡 Designing Dynamic QuickPicks in Oracle APEX

🔍 Extending Smart Search Filter for Multiple Regions

📒Designing Dynamic Inline Help Text