Skip to Main Content

UTF-8 issues

Symptoms: Report looks OK in the browser, but export to CSV gives problems with exotic characters.

Fix:
Set [Shared Components -> Application -> Definition -> Globalization ->] Automatic CSV Encoding to No.
Now when I run page 8 in your application and I download to CSV, it is properly encoded in UTF-8. Of course, when my version of Excel opens it up directly, the characters appear corrupted again because my version of Excel expects windows-1252 encoding. However, if I import the data in Excel (Data -> From Text), and I choose File Origin of 65001: Unicode (UTF-8), all of the data appears correct."


Source: http://forums.oracle.com/forums/thread.jspa?messageID=9308830&#9308830

Hide columns in CSV/PDF (etc) Export

You can hide columns by putting a condition on them of type PL/SQL Expression and using the following as the expression:
That will check the APEX bind variable "REQUEST", and if it is CSV, XLS, PDF, HTMLD or RTF then the column will not be shown.
Note that newer Apex versions also have an "Include In Export / Print" option, which might be sufficient for most purposes.

To stop a column from showing up for an email, you can use the following:

Source: http://stackoverflow.com/questions/9700660/apex-interactive-report-hide-column-in-csv-download
Note: This source suggests using XML as one of the :REQUEST options. That is incorrect, this should be HTMLD as in the example above.

Classic Report - Download Button

EmpnoEnameJobMgrHiredateSalCommDeptno
7369SMITHCLERK79021980-12-17800-20
7499ALLENSALESMAN76981981-02-20160030030
7521WARDSALESMAN76981981-02-22125050030
7566JONESMANAGER78391981-04-022975-20
7654MARTINSALESMAN76981981-09-281250140030
A simple way to remove the rather ugly "Download" link from the bottom of Classic Reports, and replace it with a nice button.
The button triggers a Dynamic Action that clicks on the original "Download" link (whose text is hidden by some css).
See the Code section below for details. Note you need a Static ID for the report region.

Note:
In older Apex versions and/or browsers the querySelector used to be different;
I assume the Apex html flow has changed since then, so if you have problems you may want to try the old version below.
Thanks to Ajay for pointing this out!
document.querySelector('#p1007-classic-report > div > div.t-Report-links').click();

Download BLOB columns

Download BLOB columns in Classic Reports are nice but tend to mess up their title and alt tags.

For example, if you use this in Appearance -> Download Text: <span class="fa fa-download" \>
then the title and alt tags of the <a> tag are also filled with that text - the HTML looks something like this:
<a href="apex_util.get_blob?s=19418592948212[...]]&rt=CR" alt="<span class="fa fa-download" \>" title="<span class="fa fa-download" \> 67 KB"><span class="fa fa-download" \=""></span></a>

Then when you hover over the link, the title tag appears as <span class="fa fa-download" \> 67 KB - not very nice...

An option would be some JavaScript like this on Page Load:

Code

Page

Identification
Page ID
Name

Region

Identification
Sequence
Title
Type
Source
Source Type
Table Name
Order By Clause
Attributes
Static ID
Region Display Selector
CSV Export Enabled
Link Text

Button

Name
Button Name
Text Label / Alt
Displayed
Sequence
Display in Region
Behavior
Action
Execute Validations

Dynamic Action

Identification
Name
Execution Options
Sequence
When
Event
Selection Type
Button
Advanced
Event Scope
True Action
Identification
Action
Settings
Code
Execution Options
Sequence
Fire On Initialization