Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8167613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:15:00+00:00 2026-06-06T20:15:00+00:00

Here is the challenge.. I have a classic report based on SQL on Region

  • 0

Here is the challenge..

I have a classic report based on SQL on Region 1 in Oracle APEX 4

The report (Report1) is structured like

    DATE_COL(this column will be hidden) or even the whole region can be hidden)
Row1    12-01-2001
Row2    11-01-2001
Row3    10-01-2001

I want to select the value of DATE_COL of Row1 which is Date1 and assigned that to a label of an ITEM which can be on the same page or another page..

The ITEM say for example is P_ITEM whose name will be displayed as 12-01-2001 on the screen

So, essentially I want to select a Row1 element of report of column DATE_COL and use that as label name

Then I wan to select Row2 element of the DATE_COL which is DATE2 and assigned to the col1 label of another report on the same page which is Report2 and will look like this

 <a href = "www.google.com"> 11-01-2001 </a> (this name is coming from report 1 of DATE_COL of Row2 element) also it has link

Row1   100
Row2   200

Please guide me how to accomplish this one.

The example html looks like this

<!DOCTYPE html>
<html>
<body>

<table id="report_R124146326020103259" cellspacing="1" cellpadding="0" border="1" summary="">
<tbody>

<tr>

<td>

<table class="report-standard" cellspacing="1" cellpadding="2" border="0" summary="">

<tbody>

<tr>
 <th id="DATE1" class="header" align="left">DATE1</th>
 <th id="DATE2" class="header" align="left">DATE2</th>
 <th id="DATE3" class="header" align="left">DATE3</th>
 <th id="DATE4" class="header" align="left">DATE4</th>
 <th id="DATE5" class="header" align="left">DATE5</th>
</tr>

<tr class="highlight-row">
 <td class="data" headers="DATE1">12-01-2001</td>
 <td class="data" headers="DATE2">11-01-2001</td>
 <td class="data" headers="DATE3">10-01-2001</td>
 <td class="data" headers="DATE4">09-01-2001</td>
 <td class="data" headers="DATE5">08-01-2001</td>
</tr>

<tr class="highlight-row">
 <td class="data" headers="DATE1">10-01-2001</td>
 <td class="data" headers="DATE2">09-01-2001</td>
 <td class="data" headers="DATE3">08-01-2001</td>
 <td class="data" headers="DATE4">12-01-2001</td>
 <td class="data" headers="DATE5">11-01-2001</td>
</tr>

</tbody>

</table>

</td>

</tr>

</tbody>

</table>

</body>
</html>

I guess JQuery can be used to accomplish, but not sure, how the selector need to use.

Thanks,
–CP

EDIT 1

I created following script based on Tom’s Jquery selector which does selects the row element. However the following script which I ran in W3Schools html editor didn’t select the row element, which I put in Test function. The test function which I am calling in “A tag” didn’t produce any results. However the other function which is WelcomeMessage did produce the result. Can anybody help me identify the error?

<!DOCTYPE html>
<html>

<head>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript"> 
    function test(i) { 
       var ab = $("#report_DT tr:eq(i) td.data[headers='DATE1']").text();
       document.write(ab);
    }

    function welcomeMessage()
    {
      document.write("Welcome to Henley's Department Store!");
    }
    </script>

    </head>


    <body>

    <table id="report_DT" cellspacing="1" cellpadding="0" border="1" summary="">
    <tbody>

    <tr>

    <td>

    <table class="report-standard" cellspacing="1" cellpadding="2" border="0" summary="">

    <tbody>

    <tr>
     <th id="DATE1" class="header" align="left">DATE1</th>
     <th id="DATE2" class="header" align="left">DATE2</th>
     <th id="DATE3" class="header" align="left">DATE3</th>
     <th id="DATE4" class="header" align="left">DATE4</th>
     <th id="DATE5" class="header" align="left">DATE5</th>
    </tr>

    <tr class="highlight-row">
     <td class="data" headers="DATE1">12-01-2001</td>
     <td class="data" headers="DATE2">11-01-2001</td>
     <td class="data" headers="DATE3">10-01-2001</td>
     <td class="data" headers="DATE4">09-01-2001</td>
     <td class="data" headers="DATE5">08-01-2001</td>
    </tr>

    <tr class="highlight-row">
     <td class="data" headers="DATE1">10-01-2001</td>
     <td class="data" headers="DATE2">09-01-2001</td>
     <td class="data" headers="DATE3">08-01-2001</td>
     <td class="data" headers="DATE4">12-01-2001</td>
     <td class="data" headers="DATE5">11-01-2001</td>
    </tr>

    </tbody>

    </table>

    </td>

    </tr>

    </tbody>

    </table>

    <a href ="default.asp">  

    <div> <Script Language="JavaScript">
                         test(i);
                      </Script>
                 </div>


    </a>


    <a href ="default.asp">  

    <div> <Script Language="JavaScript">
                         welcomeMessage();
                      </Script>
                 </div>


    </a>
    </body>
    </html>

Can anybody spot the error why test function is not retrieving the desired result?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:15:01+00:00Added an answer on June 6, 2026 at 8:15 pm

    Ideally you want to assign your region a static id (edit region > attributes > static id)

    then use

    $("#yourregionid tr:eq("+ rownumber_you_need +") td.data[headers='"+ header_id +"']").text()
    

    Take note that :eq uses a zero-index based system, so row 0 would be the one with the headers, and row 1 your first row with actual data.
    Replace header_id with the header of the column you need data from. In your example:

    $("#yourregionid tr:eq(1) td.data[headers='DATE1']").text()
    $("#yourregionid tr:eq(2) td.data[headers='DATE2']").text()
    

    Edit:

    <a href="javascript:test(1);">click for a test</a>
    <script type="text/javascript"> 
    function test(i) { 
       var ab = $("#report_DT tr:eq(i) td.data[headers='DATE1']").text();
       alert(ab);
    }; 
    </script>
    

    Edit 2:
    So if you want to actively manipulate the table headers for your second report:
    – assign a static region id to your report region 2
    – create a dynamic action for the “After refresh” event, for a region (your second region). This is necessary to allow pagination on your region while still maintaining the altered headers.
    – for true action, select an execute javascript code:

    $("#report2staticid th").each(function(index){
       var linktext, newlink;
       if(index==0){
          linktext = $("report1staticid tr:eq(1) td.data[headers='DATE1']").text();
          newlink = $("<a />").attr("href", "www.google.com").text(linktext);
       } else if(index==1){
          //something for header 2
       } else if(index==2){
          //andsoforth
       };
       $(this).html(newlink);
    });
    

    This loops over each TH element in your second report, and changes the html content of each th: we put a new A-tag in each one.

    Edit 3:
    You made some mistakes in your implementation:

    function test(i) { 
       var ab = $("#report_DT tr:eq(i) td.data[headers='DATE1']").text();
       document.write(ab);
    }
    

    should be

    function test(i) { 
       var ab = $("#report_DT table.report-standard tr:eq("+i+") td.data[headers='DATE1']").text();
       document.write(ab);
    }
    

    i is an input parameter, and you need to concatenate it into the selector string.

    Your HTML script tag is also wrong. You call test and provide “i” to it. What is “i”? Nowhere is it defined. Provide a value. (Remember, this is the rownumber.)

    <Script Language="JavaScript">test(1);</Script>
    

    Full code:

    <!DOCTYPE html>
    <html>
       <head>
          <script type="text/javascript" src="jquery.js"></script>
          <script type="text/javascript">
          function test(i) {
             var ab = $("#report_DT table.report-standard tr:eq("+i+") td.data[headers='DATE1']").text();
            document.write(ab);
          }
          function welcomeMessage()     {
          document.write("Welcome to Henley's Department Store!");
          }
          </script>
          <title></title>
       </head>
       <body>
          <table id="report_DT" cellspacing="1" cellpadding="0" border="1" summary="">
             <tbody>
                <tr>
                   <td>
                      <table class="report-standard" cellspacing="1" cellpadding="2" border=
                      "0" summary="">
                         <tbody>
                            <tr>
                               <th id="DATE1" class="header" align="left">
                                  DATE1
                               </th>
                               <th id="DATE2" class="header" align="left">
                                  DATE2
                               </th>
                               <th id="DATE3" class="header" align="left">
                                  DATE3
                               </th>
                               <th id="DATE4" class="header" align="left">
                                  DATE4
                               </th>
                               <th id="DATE5" class="header" align="left">
                                  DATE5
                               </th>
                            </tr>
                            <tr class="highlight-row">
                               <td class="data" headers="DATE1">
                                  12-01-2001
                               </td>
                               <td class="data" headers="DATE2">
                                  11-01-2001
                               </td>
                               <td class="data" headers="DATE3">
                                  10-01-2001
                               </td>
                               <td class="data" headers="DATE4">
                                  09-01-2001
                               </td>
                               <td class="data" headers="DATE5">
                                  08-01-2001
                               </td>
                            </tr>
                            <tr class="highlight-row">
                               <td class="data" headers="DATE1">
                                  10-01-2001
                               </td>
                               <td class="data" headers="DATE2">
                                  09-01-2001
                               </td>
                               <td class="data" headers="DATE3">
                                  08-01-2001
                               </td>
                               <td class="data" headers="DATE4">
                                  12-01-2001
                               </td>
                               <td class="data" headers="DATE5">
                                  11-01-2001
                               </td>
                            </tr>
                         </tbody>
                      </table>
                   </td>
                </tr>
             </tbody>
          </table><a href="default.asp">
          <div>
             <script language="JavaScript" type="text/javascript">
             test(1);
             </script>
          </div>
          </a>
          <a href="default.asp">
          <div>
             <script language="JavaScript" type="text/javascript">
             welcomeMessage();                       
             </script>
          </div>
          </a>
       </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All right, so here's a challenge for all you SQL pros: I have a
I have a challenge - I have created this little concept here . The
I have an interesting challenge that I'm wondering if anyone here can give me
So here is a little challenge. I have an image. It has 2 attributes:
This next challenge of mine involves jqtransform which can be found here http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/ I
Here's the challenge: I have a Flash movie which will be embedded in a
I have a nice challenge for you. Here you have the next code (live
This is the real challenge I brings here for you. Solve it if you
Okay, so here is my latest challenge. I am writing this for school. So
I have here a challenge that I spent some time addressing. Selenium tells me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.