Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to change the default ".csv"-file-extension to something else in report-(csv)download

joachimSep 13 2024 — edited Sep 13 2024

Hello there!

I do have a classic report-region with a sql-query as source and only one column (formatted “rich-text”) as the content.

The (simplified) report-source query is:

select
upper(a.servicename)||' =
(DESCRIPTION_LIST=
(FAILOVER = ON)
(LOAD_BALANCE = OFF)
(DESCRIPTION =
(SOURCE_ROUTE = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = aserver)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = '||lower(b.fqdn)||')(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = '||upper(a.servicename)||'))
)
)' as tnsnames
from servicestable a, servertable b
where
a.hostid=b.id
order by a.servicename;

It is basically a generated tnsnames.ora-file, which you all will know. Nothing special.

I enabled the “Download”-attribute with ‘|’ (pipe) as “CSV separator”, ‘ ’ (space) as “CSV Enclosed By” and an obvious filename “tnsnames.ora”.

(I followed the suggestions on old-but-gold https://forums.oracle.com/ords/apexds/post/downloading-report-as-txt-file-from-interactive-report-2750 , last comment)

Everything looks good, the resulting file works as intended.

Except the filename-extension.

I have to have the downloaded file as “tnsnames.ora” and not “tnsnames.ora.csv” which apex automatically generates.

Now my question is:

How can I get rid of the “.csv” file-extension?

(I know, there are several ways of generating an own file and preserve an own name to it, but I'd love to stuck with the simple and straightforward way, the classic report/download-csv process preserves)

Hope, you can help me outta that!

Cheers

Jo

(will review this on monday)

This post has been answered by joachim on Oct 15 2024
Jump to Answer
Comments
Post Details
Added on Sep 13 2024
1 comment
350 views