Hi all,
I'm using Oracle APEX 24.2 and trying to generate an Excel file from a PL/SQL package (PKG_EMPLOYEE_EXCEL_FILTERED
) that accepts a status parameter to filter the data. I am very new to this so I need your help
What I Have:
- I have a Package that downloads an excel file based on a select statement. the package takes a parameter.
- A select list (
P1_STATUS_FILTER
) with values: All, Active, Inactive.
- A button that redirects to Page 2, passing
P1_STATUS_FILTER
to a hidden item P2_STATUS
.
- On Page 2, a Before Header process runs this:
BEGIN PKG_EMPLOYEE_EXCEL_FILTERED.generate_employee_excel('employee_data.xlsx', :P2_STATUS); END;
Issues:
- The Excel file downloads immediately when Page 2 loads, even without clicking the button.
- I want the download to happen only when the button is clicked, and correctly filter by the selected status.
What I’m Asking:
- What’s the best way to pass the select list value to the package and trigger the download only on button click?
- Should I be using a branch, a specific request, or a different process point?
- How can I prevent the process from running on initial page load?