Show APEX Row Number in Report Region

I would like to display the row number in the report region at the beginning of each row for each page (based on the number of rows to display per page).
So if the number of rows per page is 15, I would want to show each row from 1 to 15. When going to the next page (16 - 31) I would like to show row 1 to 15 again next to each row.
And if the number of rows per page is 20, I want to see row numbers 1 to 20 on each page.
Since I believe an Update button only processes the current page, I would like to then use this row numbers (1 - 15) to get the values of the displayed column for each row to perform an insert to another table.

You can use something like this:
SELECT apex_item.text (1, '#ROWNUM#') row_num, empno, ename,
       deptno, comm, sal, mgr
  FROM empExample is here:
http://apex.oracle.com/pls/apex/f?p=31517:284
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • How do I set an id to a table row in a report region?

    How do I assign an id to a table row in a report region? I am trying to uniquely identify a row in the result set. What I want to do is have the report region render an id for each tr tag i.e.
    <tr id='1'>...</tr>
    <tr id='2'>...</tr>
    <tr id='3'>...</tr>
    Thanks,
    Boyan

    Hello,
    In the Before Each Row attribute of the report template you are using add something like this.
    &lt;tr id="row_#ROWNUM#">ID's in HTML should never start with a number it won't break anything but it's wrong that's why I put row_ first
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • How to get the number of rows in a report region

    Hi all,
    Is there a way to get the number of rows returned in a report region, without issuing an additional "select count(*) from some_table"?
    I mean something like the substitution string #ROW_NUM# but for the total rows.
    Thanks,
    Pedro.

    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/ui.htm#CHDDGGEG
    For classic report regions, the region footer supports the following substitution strings:#ROWS_FETCHED# shows the number of rows fetched by the Oracle Application Express reporting engine (the page size). You can use these substitution strings to display customized messages to the user. For example:
    Fetched #ROWS_FETCHED# rows in #TIMING# seconds.
    *#TOTAL_ROWS# displays the total number of rows that satisfy a SQL query used for a report.*
    #FIRST_ROW_FETCHED# and #LAST_ROW_FETCHED# display the range of rows displayed. For example:
    Row(s) #FIRST_ROW_FETCHED# through #LAST_ROW_FETCHED# of #ROWS_FETCHED# displayed>
    Ta,
    Trent

  • How to show refreshed modal window(2nd report region window) - reposting

    Hi,
    I have a requirement where i scroll thru different rows in grid region.
    Moment I tab out from first row, I pop up 2nd report, where I show related detailed data lines for the tabed out line of first grid.
    So my 2nd window is a report region query, whose 'where' clause contains the primary key from the row of first grid window.
    On tab out of a row of first window, I have a javascript function, which shows 2nd report region using:
    var mywindow =
    window.showModalDialog
    ('http://MY-URL-/ebus/apexQA111/f?p=&APP_ID.:25:&SESSION.',myObject,'dialogWidth=800px;dialogHeight=300px;dialogLeft:50;dialogTop:50');
    Problem:
    On First tab out, I get the correct data display on 2nd window, which is related to current tabbed out row.
    However, If I tab out from next record, modal window pops up and it still shows my detailed data of first tabbed out row.
    Somehow the 2nd window is not getting refreshed/recalculated based on my new tabbed out row. I only have showmodaldialog in my JS function.
    Anyway to refresh the window based on new values of the where clause variable? and then showing the window?
    Please help!!
    Regards,
    Ravi.
    Edited by: Rave on Nov 26, 2009 6:15 AM

    Hi Rave,
    You can refresh any window with the java script below, just make it conditional on the value of an item within your page so that it dose not run every time the page is loaded.
    if ($v('P1_MY_ITEM') === 'foo' ) {
    window.location.href = document.location.href;
    }

  • APEX 3.0 Print report region

    When I want to print a report region, and choose A4 as "Paper Size", Adobe cannot open the PDF document. Adobe says that the document is not a supported file type or because the file has been damaged.
    When I choose Letter as "Paper Size" the PDF document is generated as expected without any errors.
    Does A4 not work?
    Greetings,
    Guido

    I have configured printing to work in my version of Apex. I am running APEX 3.0 on a 10gR2 platform. The steps I did were as follows:
    - Install a working JDK and add the JAVA_HOME\bin directory to you path
    - Follow the instructions on this page (under Apache-FOP heading): http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
    Only two downloads are necessary - the JSP and the FOP from apache. Use the lower link, and download a -bin file on windows.
    - Follow instructions on where to place files, and the edit application.xml configuration.
    - Set up OC4J - cd Oracle_home\oc4j. Read the readme.
    - In essence this means
    1) cd Oracle_home\oc4j\j2ee\home and run "java -jar oc4j.jar -install"
    2) OC4J now needs to be started - "java -jar oc4j.jar"
    3) Point your browser at http://localhost:8888, and the page should show. If not, you can check the command window for OC4J to see any errors - I am not an expert, it just worked for me.
    - Now set up APEX through admin (again using instructions in the link) to specify the print attributes
    - Make sure OC4J is running and try to print a report
    - Hey presto, Bob's your uncle!
    Obviously, OC4J needs to run on the server to generate the prints.
    Hope this helps,
    Graham

  • Get information from a row in a report region to be used in conditions

    Hi,
    I have a page with 2 regions.
    First region is a report from a table (departments) and the other region is another report region (employees).
    One of the columns in the departments report is a link that when I click on it, it will refresh the second region to show the employees by department.
    My issue is when I open the page for the first time or get back from another page, I want to show by default the employees for the first department. I don't know how to get this value and assign it to a a Page Item and use this page item in the second report.
    I appreciate any help.
    Thanks
    andrese

    Andrese
    For page item (which you populate when user clicks on department report link), write default value as plsqlfunction body and try something like
    DECLARE
    v_dummy tbl_dept.dept_id%TYPE;
    BEGIN
    SELECT dept_id INTO v_dummy FROM tbl_dept WHERE ROWNUM = 1;
    RETURN v_dummy;
    END;I take it you populate dept_id into page item, when users click on department report link. You can change this according to your requirement. Also make sure that the SELECT query matches with your department report query so that first row of your department report always matches with above SQL query output.
    Please note that this may not work if your department report query contains any GROUP BY/ORDER BY/HAVING clauses
    Cheers,
    Hari
    Edited by: Hari_639 on Oct 5, 2009 9:04 PM

  • APEX BUG in export report region  to CSV

    Upgraded to APEX 4.1 but I have the same problem !!!!
    any help ????
    regards
    saverio
    ==============================================
    Hy all,
    I have a Classic report based on a PLSQL function returning SQL query. (APEX 4.0)
    The query is like this (it is just an example; at the bottom of the post I attach my real query)
    select * from (select c1,c2,c3
    from table1
    where c1 in (select c from table2 where ct2 = :P0_ITEM1)
    where instr(upper(c2),upper(nvl(:P5_REPORT_SEARCH,"c2"))) > 0
    where P0_ITEM1 is an item in page 0 and P5_REPORT_SEARCH is an item in my page (where I have the report) used to "filter" the rows.
    The report is OK; it is correctly displayed and the number of rows are correct (filtered by the where clause)
    but when i try to export it to CSV i get a wong number of rows.
    It seems that the where conditions (both) are NOT applied and in the CSV file I get all the rows of my table1.
    The report have 2 break colum (c1 and C2).
    Any idea of what is wrong ?
    regards
    saverio
    =============================
    My real query is that:
    declare
    q varchar2(4000);
    w varchar2(4000);
    w2 varchar2(4000);
    begin
    q:=' select * from (select "COSTIFISSI_COMMESSE"."ANNO" as "ANNO",';
    q:=q||' "COMMESSE"."CODICE" as "CODICE",';
    q:=q||' "CLIENTI"."DESCRIZIONE" as "NOME_CLI",';
    q:=q||' "COMMESSE"."CODICE_COMFME" as "CODICE_COMFME",';
    q:=q||' "COSTIFISSI_COMMESSE"."CODICE_COMF" as "CODICE_COMF",';
    q:=q||' "COSTIFISSI_COMMESSE"."M01" as "M01",';
    q:=q||' "COSTIFISSI_COMMESSE"."M02" as "M02",';
    q:=q||' "COSTIFISSI_COMMESSE"."M03" as "M03",';
    q:=q||' "COSTIFISSI_COMMESSE"."M04" as "M04",';
    q:=q||' "COSTIFISSI_COMMESSE"."M05" as "M05",';
    q:=q||' "COSTIFISSI_COMMESSE"."M06" as "M06", "COSTIFISSI_COMMESSE"."M07" as "M07",';
    q:=q||' "COSTIFISSI_COMMESSE"."M08" as "M08", "COSTIFISSI_COMMESSE"."M09" as "M09",';
    q:=q||' "COSTIFISSI_COMMESSE"."M10" as "M10", "COSTIFISSI_COMMESSE"."M11" as "M11",';
    q:=q||' "COSTIFISSI_COMMESSE"."M12" as "M12", "COMMESSE"."AREA" as "AREA", ';
    q:=q||' nvl(m01,0)+nvl(m02,0)+nvl(m03,0)+nvl(m04,0)+nvl(m05,0)+nvl(m06,0)+nvl(m07,0)+nvl(m08,0)+nvl(m09,0)+nvl(m10,0)+nvl(m11,0)+nvl(m12,0) as Tot_Anno';
    q:=q||' from "CLIENTI" "CLIENTI", "COMMESSE" "COMMESSE", "COSTIFISSI_COMMESSE" "COSTIFISSI_COMMESSE" ';
    w:=' where "COSTIFISSI_COMMESSE"."CODICE_COMR"="COMMESSE"."CODICE" and     "COMMESSE"."COD_CLIENTE"="CLIENTI"."CODICE_SIAL"';
    if :P0_RUOLO ='SM' then
    w:=w||' and codice in (select codice from commesse where sm in (select matricola from lavoratori where upper(uid_ldap)= '''||upper(:APP_USER) ||''' ))' ;
    elsif :P0_RUOLO ='AREA' then
    w:=w||' and codice in (select codice from commesse where area = '''||:P0_AREA||''' )';
    elsif :P0_RUOLO ='ADM' then
    null;
    end if;
    w:=w||')';
    w2:=' where ( ';
    w2:=w2||' instr(upper("AREA"),upper(nvl(:P5_REPORT_SEARCH,"AREA"))) > 0 or ';
    w2:=w2||' instr(upper("CODICE"),upper(nvl(:P5_REPORT_SEARCH,"CODICE"))) > 0 or ';
    w2:=w2||' instr(upper("NOME_CLI"),upper(nvl(:P5_REPORT_SEARCH,"NOME_CLI"))) > 0 or ';
    w2:=w2||' instr(upper("CODICE_COMFME"),upper(nvl(:P5_REPORT_SEARCH,"CODICE_COMFME"))) > 0';
    w2:=w2||' )';
    q:=q||w||w2;
    return q;
    end;
    Edited by: tirone on 9-giu-2011 23.44
    Edited by: tirone on 29-giu-2011 9.15
    Edited by: tirone on 27-ott-2011 5.15
    Edited by: tirone on 2-nov-2011 6.53

    thanks for your answer,
    but my problem is that I get (only in the CSV file) a superior number of lines to how much I expected me, NOTsuperior.
    Aniway i set the maximum row count in report attributes to 50000, but the problem is not solved.
    regards
    saverio

  • Show Image in an SQL Report Region

    Hi,
    I'm having some trouble with showing an image in an sql report region.
    I used the Upload/Download Tutorial in the HTMLDB How-Tos and it worked well.
    Now, I have the following in the query region:
    select s.facilityid, s.id, s.name, s.subject,
    '<img src="#OWNER#.download_my_file?p_file=s.id" width="90" height="70">' image
    from file_subjects s
    where s.facilityid = :FACILITYID
    I get a red X in place of the picture. I know that the pictures are there and have been uploaded successfully. Can anybody tell what I am doing wrong?
    Thanks much,
    Nora

    Nevermind, I fixed it by changing the image line to
    '<img src="#OWNER#.download_my_file?p_file=' || s.id || '" width="90" height="70">' image
    Thanks
    Nora

  • Enable particular row of apex_item report region....

    Hi guys,
    I have a report region.i used apex_item to create report region.
    select apex_item.checkbox(1,ADDRESS1)
    chk_bx,apex_item.text(2,ADDRESS1) Address,apex_item.text(3,ITEM1) Item,null from address_details;On page load i disabled the report region by using below javascript
    function disableItems(pRegionStaticId,pDisableFlag) {
    alert('disa');
      $('#'+pRegionStaticId).find('[name^=f]').each( function(){ /* matches fxx */
        if( $(this).attr('name').match(/f[0-9][0-9]/) ){
          return $(this);
      }).attr('disabled',pDisableFlag);
    }After the report region get disabled,i have to enable a particular row of report region, ie when i set click first row f01[0] (f01 is checkbox), then i enable that row(clicked row), if i click second row f01[1],then i have to enable that row vice versa...
    Is that any javascript to achive this?
    Thanks in advance

    Hi
    i have a report with parameter is the year i can select a multiple value.
    Below is an example for the result:
                                    year
     Data        2010    2011   2012  
     hp          14         25           30    
     Dell        17         18           20
    i need to get the value of the last previous i mean i this example i have the last year is 2012 i need the value of 2011
    i tried a script with vb.net but i don't get the result i get only the value of year this is my script
    Dim Shared Num1 As StringDim Shared values As System.Collections.ArrayList=New System.Collections.ArrayList()Public Function GetVal(Val as Integer,Year as Parameter)  as String   If Year .IsMultiValue then    For i as integer=0 to Year.Count-2          Num1= Year.value(i)                       Next    End If   Return Num1End Function
    this script return me 2011 but me i want the value in of the year 2011
    thanks

  • Export for all rows of a Report Region

    Hi,
    I have a html region with a query button to restrict which rows get selected in a reports region below it.
    But I also want to have a link to export all rows in the report to a csv file. Button the report region may already
    have selected data in it that is not necessarily all rows in the report. Thus I guess I am wondering if I should
    create a whole separate hidden report region that will always select all rows in the query to relate the
    export link to? Or if I can someone use the current report region and select all rows for the export but
    not requery or change the currently displayed report regions results?
    Thanks in advance!

    Yes I just created a hidden report i.e. one with all columns set to
    APEX_APPLICATION.G_EXCEL_FORMAT = TRUE
    And then just create a javascript function to call the export routine...

  • Show all rows in interacive report

    Hi there,
    I built an interactive report, when I run the report it shows just 15 rows with the ability to see the next 15 rows -
    Iam asking how to show all rows as a default whenever the user runs the report.
    Regards,
    Abdul

    I saw in another thread that the trick is to log out as the developer and close the browser. I tried that and now it appears that my change to 100 rows as the default report rows seems to hold when I log in just to the application in another browser. When I tried it without logging out, it did not seem that the default became active--even when going in through another browser. Seems like a bug that should be fixed??
    Pat

  • Showing all rows in updatable report

    Hi everyone,
    the users of my application have requested the option of showing all records, even though the updatable report has pagination turned on. How can this be achieved at run time?
    Thanks a lot,
    Henrik

    By specifying a select list - some static LOV for the number of rows you want to show. You can enter the name of that item in your report properties - Number of Rows Item.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Current value of a column.row in a Report region

    Hi
    I have a report that I want to display a single row per page. No problem there. I also want to show, in a separate region below the value of two specific columns for that row (they are large text items that I want to show as text areas).
    My problem is how to have the source of the text area data items match the current report row above. What I want is sort of;
    SELECT TEXTFIELDNAME FROM TABLE WHERE KEY = value from column1 in the report above above (like the #EMPNO# notation when linking a report column to another page)
    Or maybe there is a better way ?
    Any pointers much appreciated.
    Jules

    Hi Jules,
    As always you've some options to achieve what you would like to do.
    If you know AJAX, you could do it that why, if not an "easier" why of doing it:
    1) Create an hidden item
    2) In your report make a link to the same page, but give as parameter the hidden item with the pk as value
    3) In your where clause of your select to fill in the text area, you search for the hidden item (WHERE key = :HIDDEN_ITEM)
    Hope that helps,
    Dimitri
    -- http://dgielis.blogspot.com

  • Can I change the reort total: text in the summary row in a report region?

    Hi all,
    This might has been asked before, I tried searching the forum but couldn't find an answer. In the report attribute, if I tick the sum checkbox then run the page, the last row would give me the summary numbers which is what I want. However is there a way I can change the "report total" text in the last row of the first column?
    Thanks very much for your time.
    Pete

    Hello user9546327,
    I had the same problem, until I realised that the text seems to be printed under the first column of the report. If that one is a hidden column, the text won't be printed in the report.
    Solution:
    In the 'Report Attributes' tab, move the first visible column (= attribute 'Show' is ticked) to the top of the report columns.
    Best regards,
    Sabine

  • Dimension variable shows two rows in Webi report

    Hello everyone!
    I want to build a report with the following structure:
    Account group 1 | KYF 1| KYF 2
    For this effect, I've created a dimension variable called "Account group 1" with a formula like "GL account starts with "64"".
    With this I'm getting two rows: one with the correct value and another with the aggregated value of the remaining accounts.
    How can I make this return only one row with the restricted values I want?
    Best Regards,
    Luís Andrade.

    Hi Luis,
    There are two ways to do it.
    1. Simplest solution use a report filter by selecting the Account Group column and selecting the accounts.
    2. If the above one doesn't work if the report refreshes and new accounts come in, the other way is create one more variable named group2 or something, as dimension and use an if statement where if account group = account starting with GL Then group1 Else NULL. now apply the report filter where group2 not equal to "NULL". Now you will not have the last row as before.
    I think one of this should be helpful.
    Thanks,
    Rajesh

Maybe you are looking for

  • How Can I Search for Media files by Length?

    I want know how can I search for media files (mov, mp4, flv and movie files in general) by their length? If this search function is confirmed as definitely not possible on the OS, I would appreciate someone recommending app that might be able to perf

  • How to insert into date column based on other columns?

    Hi I have four columns in a table called game named as R_Day - Type - Number R_Month - Type - Number R_Year - Type - Number R_Date - Type - Date I have around 1000 records and i want to fill R_Date column based on the data in the R_Day,R_Month,R_Year

  • Why does COD2 ask for Rosetta in 10.6?

    Hi, I just did a clean install and updated to 10.6.1 but when i try to run the Call Of Duty 2 update it says i need to install Rosetta. How come it asks for this when COD2 is a "universal" application? I never had this under Leopard?

  • Single email account, cannot open inbox

    Hi, I've switched email accounts, and had to change it on my iPod Touch. I've added my new Gmail account, made sure it worked, and then removed my ISP's email account. I've had 2 email accounts for about an hour. After deleting the old account, I fou

  • OSX Snow Leopard install problems

    I need to install Snow Leopard over 10.5.8, but can't get the install to complete.  If I do a straight install, it'll progress for about 15 mintues, then notify me that the install will complete on restart.  If I resart, the disc will eject in the st