Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

javascript - Oracle Apex opening a column link in interactive report?

I have column link in an interactive report. This column link should run an sql query which supposed to return an external URL so I want to open in a new tab/page. How can I do that?

enter image description here

Somehow with a dynamic action? ..but I cannot make dynamic actions for columns furthermore I should query the data from the table-column.

Thank you!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From my point of view, your current column link should not run any query. What it should & could do is to call a function which returns URL. Something like this:

select id,
       name,
       f_url(parameters, go, here) url   --> this
from some_table
where ...

How to do it?

A dummy function; mine returns link to Google. Yours would return something different.

create or replace function f_url return varchar2 is
begin
  return 'https://www.google.com';
end;
/  

In Apex, interactive report's query looks like this; note the URL column which composes a HTML tag to URL returned by the function I previously created:

select deptno, dname, loc, 
  --
  '<a href="' || f_url || '" target="_blank">click here</a>' url
from dept

URL column's properties:

  • type: plain text (not a link!)
  • escape special characters: No (otherwise, instead of a link you'll see plain text)

Run the page; result is

image

When you click on "click here", a new tab - with the Google search page - will be opened.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...