Overview :
Using this we can download a CSV file from the interactive report by calling it from another page with parameters. It will directly download the CSV file without opening that page having the interactive report.
Technologies and Tools Used :
The following technology has been used to achieve the same.
Oracle Apex
Use Case :
It is used to reprocess the Report Page using Download button.
Using this we can download a CSV file from the interactive report by calling it from another page with parameters. It will directly download the CSV file without opening that page having the interactive report
Architecture :
The following steps will explain how to Download CSV from Interactive Report from Another Page
Step1: Report Create a Page in Oracle Apex for the Interactive Report
created a page number 2 and created an Interactive Report in it with a Page Item P2_EMPID.
Used the following SQL query and the settings for the interactive report:
select EMPLOYEE_ID,
FIRST_NAME,
LAST_NAME,
EMAIL,
PHONE_NUMBER,
HIRE_DATE,
JOB_ID,
SALARY,
COMMISSION_PCT,
MANAGER_ID,
DEPARTMENT_ID
from EMPLOYEES
where employee_id = :P2_EMPID
Page Items to Submit: P10_EMPID
Step2: Set the Attributes of the report as shown in the below image.
Save the changes for Page 10. Now we will call this report from another page with that page’s Employee ID as a parameter to Page 2.
Step:3 Create a Button on Another Page to Download CSV file
I have a Page 3 in my application having the item P3_EMPLOYEE_ID.
Created a button “Download CSV” with target action to “Redirect to URL” and added the following URL in it:
f?p=&APP_ID.:2:&SESSION.:CSV:NO:RP:P2_EMPID:&P3_EMPLOYEE_ID.
Note: in the above URL, that I am passing the page item P3_EMPLOYEE_ID as a parameter to page 10 item
P10_EMPID.
Also, you can change the CSV to other formats such as PDF, XLS, RTF, etc.
Save the changes for the page and run the page to test.
Now when you will click on the Button Download CSV it will directly download the CSV for the employee id stored in page item P3_EMPLOYEE_ID.
Below is the sample of CSV content:
Conclusion :
In this document, We have seen how to download csv from another page.