3
votes

The description of the task:

Our current reporting system that we are trying to modernize/replace utilizing oracle APEX is written in php.

It has some predefined reports with parameters the users can run, as well as “custom report builder” that allows the user to build the custom report by selecting parameters, table columns, and other operators to help build the query that generates the report.

All options allow the user to download the report output into Excel file. Some users with advance SQL knowledge are given option to write their custom quires to generate the output. They would write the query in the text window and then generate the output.

I have to duplicate this functionality in APEX 5.2.

I have done this by creating the Textarea item where user types the query and a Classic Report region based on PL/SQL Function Body Returning SQL Query, than passing this value to a PL/SQL block returning a query. I had to use the “Use Generic Column Names” option for this to work.

I can generate the output this way.

The problem/issue encountered:

Since it can only be a Classic Report (based on PL/SQL Function Body Returning SQL Query ), I do not have a build-in option to download to Excel. In addition, all APEX plugins for this purpose that I have found/tried are designed for Interactive Reports/Grids as well.

So:

  1. Can you suggest a better way to approach the task?
  2. If my approach looks OK, any suggestion for download to Excel option (via button) ?
1

1 Answers

1
votes

Here's how:

  • navigate to reports's Attributes page
  • scroll down the properties; you'll see the "Download" section
  • set "CSV export enabled" to "Yes"
  • set other properties (if you want; a separator, link text, ...)
  • run the page
  • you should see the "Download" link at the bottom of the region