Search This Blog

Saturday, July 12, 2025

How do I Create a Classic Report with data entry form

 Introduction
Creating a Classic Report with a data entry form in Oracle APEX allows developers to display existing records while enabling users to input or update data through an integrated form. This is a common design pattern for applications that manage records such as customers, orders, or tasks. The Classic Report presents data in a clean, readable format, while the form provides a user-friendly interface for creating or editing records. This blog will walk you through the steps to build this structure in a way that’s efficient, intuitive, and fully integrated with your APEX application.

 To create a Classic Report with a data entry form in Oracle APEX, you'll use two main components: a Classic Report to display existing records and a Form to allow users to add or edit individual records. Oracle APEX provides a built-in wizard to create this type of Master-Detail interface efficiently. Below is a step-by-step guide to building it.

Step 1: Prepare Your Table
Before building the pages, ensure you have a table in your database to work with. For example, a simple CUSTOMERS table with the following columns:

CREATE TABLE CUSTOMERS (
  CUSTOMER_ID NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
  FIRST_NAME  VARCHAR2(100),
  LAST_NAME   VARCHAR2(100),
  EMAIL       VARCHAR2(150),
  CREATED_AT  DATE DEFAULT SYSDATE,
  CONSTRAINT CUSTOMERS_PK PRIMARY KEY (CUSTOMER_ID)
);

Step 2: Create a New Classic Report with Form Page

  1. Open your application in APEX.

  2. From the App Builder, click Create Page.

  3. Choose Report > Classic Report.

  4. Select With Form – this tells APEX to generate both the report and the form.

  5. Choose your table (e.g., CUSTOMERS).

  6. Select the primary key column (APEX usually detects this automatically).

  7. Define the navigation:

    • You can let APEX create a navigation button or link from a column to the form.

  8. Optionally include Create and Delete capabilities.

  9. Click Next and Create.

This process generates two pages:

  • A Classic Report page (e.g., Page 1) that displays your table rows.

  • A Form Page (e.g., Page 2) where you can view or edit a single row.

Step 3: Configure the Classic Report

  • Go to the report page in Page Designer.

  • Under Columns, locate the link icon next to the primary key column.

  • Click it and review the Link settings—it should navigate to the Form page, passing the primary key value as a parameter (e.g., P2_CUSTOMER_ID).

  • You can also enable a Create button to add new records:

    • Under Buttons, find the Create button.

    • It should link to the Form page without a primary key value, which triggers Insert mode.

Step 4: Configure the Form Page

  • On the Form page, APEX will automatically include processes like:

    • Fetch Row from CUSTOMERS (runs when the primary key is passed)

    • Process Row of CUSTOMERS (handles insert/update based on mode)

    • Delete Row from CUSTOMERS (if you enabled delete)

  • The page items (e.g., P2_FIRST_NAME, P2_EMAIL) will be automatically mapped to the table columns.

  • You can customize item types, labels, validations, and default values.

Step 5: Save and Run the Application

  • Click Save.

  • Run the report page.

  • You should see a list of records with an Edit link and a Create button.

  • Click Edit to modify existing records.

  • Click Create to add a new customer.

Step 6: Optional Enhancements

  • Add validations to ensure fields like email are correctly formatted.

  • Add dynamic actions (e.g., show/hide items based on input).

  • Use Interactive Report instead of Classic Report if you need filtering and export options.

  • Use APEX page authorization to restrict access to the form.


Creating a Classic Report with a data entry form in Oracle APEX allows users to view and manage data in a structured and user-friendly way. Using the built-in wizard, you can quickly generate both pages and wire them together using standard APEX features. With a few customizations, you can turn a simple report/form interface into a powerful data management tool.

 

In Oracle Application Express (APEX), integrating a Classic Report with a data entry form on the same page enhances user experience by enabling both data viewing and input within a single interface. To achieve this integration, follow these steps:

  1. Create the Classic Report:

    • Utilize the Create Page Wizard in APEX to generate a Classic Report based on your chosen data source. This process involves specifying the report's data source, such as a table, view, or SQL query, and configuring attributes like the report's name and navigation settings. 

  2. Create the Data Entry Form:

    • Within the App Builder, initiate the creation of a new page and select Form as the component type.

    • Choose the appropriate form type, such as Form on a Table or Form on a SQL Query, depending on your data structure.

    • Define the form's attributes, ensuring it targets the same data source as your Classic Report to maintain consistency. 

  3. Link the Report and Form:

    • In your Classic Report, configure a link (e.g., an Edit button) that directs users to the same page but switches the page mode from Report to Form.

    • Pass the primary key of the selected record as a parameter in the URL to identify the specific record for editing.

    • On the form page, utilize this parameter to retrieve and display the corresponding record, allowing users to edit the data seamlessly. 

This setup allows users to view data in the Classic Report and edit individual records using the form, streamlining data management tasks.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.


A screenshot of a computer

AI-generated content may be incorrect.

Is critical that you pay attention to the following fields: 

A screenshot of a computer

AI-generated content may be incorrect.


Select the primary key.

A screenshot of a computer

AI-generated content may be incorrect.


You should now have two new pages with the names that matches what you entered in the previous screens.

A screenshot of a computer

AI-generated content may be incorrect.


Note: if you try running the ClassicReport_Form by itself you will get the following error:

A green background with white text

AI-generated content may be incorrect.


When you run the “ClassicReportWithForm” page you get the following result:

A screenshot of a computer

AI-generated content may be incorrect.

If you click on the “Pencil” link you get the modal “form” page.

A screenshot of a computer

AI-generated content may be incorrect.

Notice that the “State_ID” field displays as a deropdown with all of the states.

A red rectangle with a white border

AI-generated content may be incorrect.

If you click on the control you see the list.

A screenshot of a computer

AI-generated content may be incorrect.

You also get some “pre-wire” buttons for the form:

Conclusion
Combining a Classic Report with a data entry form in Oracle APEX creates a seamless experience for both viewing and managing data. This setup is ideal for business users who need to browse records and make quick edits or additions. By following the correct steps and using APEX’s declarative features, you can build a robust and user-friendly interface that keeps your application clean, responsive, and functional.

No comments:

Post a Comment

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...