Conditionally display button based on number of rows in rpt query results?

I know that I can conditionally display a button based on the number of rows returned in a query entered in the condition. However, I have a report region button that I only want to display if any data was returned by a report query. Since I've already executed the query to generate the report, I do not want to execute it again to determine whether any rows were returned. Is there any way to detect whether any rows were returned for a report other than to reissue the query?

http://htmldb.oracle.com/pls/otn/f?p=24317:52
OK, so it looks like it contains the rowcount of the report region rendered just before the variable (apex_application.g_flow_total_row_count) is referenced.
Sort of like how SQL%ROWCOUNT contains the no. of records affected by the last SQL DML statement.
Note that the pagination scheme affects the result. In the example above, the 2nd report region is showing 10 rows with a 'Rows X to Y' pagination scheme. So g_flow_total_row_count=11 because I guess the reporting engine has to fetch the 11th row (and discard it) to determine whether to render the 'Next' pagination link.
If you select a pagination scheme that forces the reporting engine to fetch all the rows 'Rows X to Y of Z', g_flow_total_row_count will always be Z, not the number of rows actually rendered on the screen.
Thanks

Similar Messages

  • Limit Number for Rows in BW Query Result

    Hello Experts,
        I am creating a query to be consumed by a web service. Therefore, I want to restrict the number of rows the query can display. Does anyone know a way to limit the result set to display only say FIRST 100 rows of data?
        I have looked at 'safety belt' solution, i.e. limiting number of cells to for example, 5000 cells. However, when the limit is exceeded the query just shows an error message not the first 5000 cells.
    thanks,
    Kartik

    Hi,
    You can do some things like..........
    Do not display the data in a detailed level.
    Use Always Suppress option in the result set.
    Also it depends on your Query definition. If your rows contains Branch wise or Region Wise, then your report will be fit in your first level of output. You need not to drilldown further.
    Why do you want to consider only first 1000 rows if you are planning to use it by Web service?
    I don't know whether it is feasible or not. I have one more alternative for you. You can try to achieve by APD by the Query. Insert a ABAP routine which should consider first 1000 result rows for your Web service. Just throw a light on this idea..............
    Regards,
    Suman

  • BEX analyzer -Maximum number of rows (65535) exceeded. Result is incomplete

    Hello Experts,
    I am trying to Run a report on BEx Analyzer.There are around 200,000 records to be displayed in the result.
    I am getting the below error.
    Maximum number of rows (65535) exceeded. Result is incomplete.
    Message no. BRAIN675
    We are on SAP GUI 7.X and Excel 2007
    Is there any setting that I have to change inorder for BEX analyzer to display all the 200,000 records.
    Also any memory setting for the result set to be changed ?
    Please let me know your thoughts
    Thanks
    Doodle

    Hi Doodle,
    The rows limit for Excel 2007 is 1 million so this is not the problem with row limitation. It seems like you have opened the pre-excel 2007 workbook in excel 2007, check your title bar if it says "Compatible Mode". This will limit you to old standard of 65K.
    May be what you can do is , save your file using save as option and try running the workbook.
    Your new file extension will be .xlsx
    Regards,
    Durgesh.
    Edited by: Durgesh Gandewar on Jul 14, 2011 10:03 AM

  • How do you limit the number of rows return from query?

    How do you limit the number of rows return from query? Do all databases support this kind of feature?

    i think the standard is limit
    to get the top 30
    select * from mytable LIMIT 30;returns the first 30 rows
    also if you want a range
    select * from mytable LIMIT 10,30;returns 30 rows starting from 10
    this last one is useful for displaying ranges... something similar happens in these forums when viewing topics and messages

  • How can I get the number of rows in my sql result, without a loop?

    Hello,
    I've a problem, I would like to get the number of rows in my sql result without make a loop like :
    while (rs.next()){
    int number = rs.getRow();
    Is there any method to do this, on the first element?
    Thx, STeF

    If you want to count how many rows are in result set, I dont think you can, but you could always run a count statement for that sql
    say your sql is
    select field1, field2, field3
    from table1, table2
    where field4=field5 ......
    then you can count the rows this statement returns by
    select count(*) from
    (say your sql is
    select field1, field2, field3
    from table1, table2
    where field4=field5 ......)
    This way you will get the count for just that sql

  • RPD - Cannot obtain number of columns for the query result :Working with MS SQL 2012 schema

    Hi All,
    I have created my warehouse in MS SQL 2012.
    For management purpose, I have created different schemas in SQL database
    In RPD, Physical layer, when i view data > I get error as
    [nQSError:16002] Cannot obtain number of columns for the query result.
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'tbl'..
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Statements could not be prepared..
    I have already browsed : OBIEE 11g Strange ODBC Driver Error with SQL Server : Total Business Intelligence ... did not help me
    please help!!!

    Hi All,
    After all R&D it is been found that Oracle business administrator( RPD) needs default dbo schema. It doesn't accept custom schema for pulling data.
    If anybody have other views please share.!!
    Thank you

  • How to conditional display Report Region based on number of rows returned

    I have a page with two Report Regions.
    One Region should display if the Query returns 0-1000 rows. The other should display if the same Query returns more than 1000 rows.
    The only way I can figure out how to do this is have ANOTHER query in the conditions field for each Region to Select count(*) from etc.
    I know there is a #TOTAL_ROWS# value but that is only available after the Region is displayed. Is there some other built-in variable that can be used to put in the Conditions field or is doing duplicate SQL queries the only way?
    Any help would be appreciated.

    Rather than running your query 4 times (by embedding it in your condition), you can have a region that is not displayed, with a hidden item, and set the value of the item in a before header computation to the count of your query. Now you can conditionally display based upon the value of that item.
    -- Sharon

  • Conditionally display button in a report

    Is there a way to conditionally display (or disable) an edit button that is displayed on each row of a classic report in version 3.2 ?
    ie. lets say an orderShipped field exists. If the orderShipped is null (not yet shipped), that row will display (enable) the edit button. If orderShipped exists and the date is displayed, the order button is hidden (or disabled).

    Hi,
    there are probably many ways to do this so this is just one.
    Write a report query something like this:
    SELECT id,
    name,
    CASE
    WHEN order_shipped IS NULL THEN
    '<a href="f?p='||:APP_ID||':'||10||':'||:APP_SESSION||':::::P10_ID:'||id||'"><img src="edit.gif"/></a>'
    ELSE
    'OK'
    END AS edit_col
    FROM orders;
    Change according to your requirements.
    Regards Garry

  • To divide the table based on number of rows

    Hello,
    I am trying to divide a table based on the number of rows and then to process it.
    Say i have a table TEST_XXX which contains 50 rows, what i would like to do is,
    to access rows in multiple of 10. How can we do this ?
    What i was thinking is, once the table gets created and row are filled in,
    add a new column to the table and run a procedure which inserts 1 to first 10 rows
    and 2 to next 10 rows and 3 to next 10 row ...etc. Based on this we can process
    the first set of rows then next set or rows etc ....
    is there a better way to do this ?
    Code to create the table :
    CREATE TABLE TEST_XXX
      A_ID   VARCHAR2(10),
      B_ID   NUMBER,
      c_ID   VARCHAR2(10),
      D_ID   NUMBER
    )Code to add rows:
    DECLARE
    BEGIN
      FOR I IN 1..50
      LOOP
          INSERT INTO TEST_XXX VALUES('ABCDE',123,'ZYXWV',321);
      END LOOP;
      COMMIT;
    END;The original problem is, i do have a huge table, and i write a sql query to process it,
    when i process it selecting all values from table, it is very slow.
    But when i process it in small chuks(say 100 rows) it works fine.
    Thats how i was the above approach in mind.

    The original problem is, i do have a huge table, and i write a sql query to process it,
    when i process it selecting all values from table, it is very slow.Did you trace both the implementations and see why it is taking longer?

  • Conditional display of region with PL/SQL function returning SQL query

    Hello,
    ApEx 2.0.
    I use PL/SQL functions that return SQL queries to display the contents of a region.
    How could I conditionally display such region ? If no data is found, the region shouldn't be shown. I tried with "SQL query returns at least one row" but this doesn't seem to work.
    Thanks,
    Matthias

    Hi Matthias,
    Are the regions in question report regions? So your PL/SQL process is returning a SQL query and then populating a report?
    The EXISTS(SQL Query returns at least one row) condition should work, try running the query you are using in the Expression 1 textarea inside SQL*Plus, or SQL developer using the same parameters, and see what gets returned.
    If you are still stuck, can you post the query you are using inside your Expression 1 textarea of the Conditions section and I can take a look at it for you.
    Hope this helps,
    Cj

  • Wish to find out number of rows returned from query

    hi,
    is it possible to determine how many rows have been returned after a query has been executed?
    thank you.

    It doesn't seem like there is a method to do it for you, [...]There can't be such a method that's guaranteed to work for all databases. Many databases just hand you a cursor with the query results, and you have to walk the cursor to find the complete set. It's even possible for the DB to continue computing the query in the background and just give you a cursor to walk and consume what it has already generated.
    So no, you have to walk the result set (effectively pulling everything over to the client) to count the number of rows..

  • Styling report rows using the query result

    Hello, is it possible to style a row in a report using the values returned by the underlying sql query?
    For example, if my query returns a column called ROW_CLASS I would like to use the placeholder #ROW_CLASS# to style the row, e.g. specifying the row class.
    Apparently such row attributes are not available to the apex developer. For each single column value I can set the "Tabular Form Attributes" and "Column Formatting", but I cannot set anything on the whole row.
    In other words I can style the TDs but not the TRs.
    I think this is clearly a "missing feature" that should be there, single the APEX engine that turns the query result into the HTML that displays the table can already access the column values via their placeholders. It would be sufficient to add some "row attributes" or "row class" field in the report.
    It could be used for lots of useful things, in my particular case, highlighting rows that contain errors.
    Also there is no way to perform that operation in CSS (e.g. get the TRs which contain at least one TD of class "ROWERROR"). I know it could be done in JS, but that's very messy for such a simple declarative problem.

    GChierico wrote:
    Hello, is it possible to style a row in a report using the values returned by the underlying sql query? Yes, for standard reports, using custom report templates: +{thread:id=2493917}+
    Interactive reports require the use of Dynamic Actions/jQuery.

  • Want to create multiple button based on no.of rows

    sir,
    I have one table and it has two columns. First column has Title and second column has Yes / No
    My page should display the no.of buttons with tittle based on the creteria of Yes.
    For example I have 5 rows. second columns has Yes in 3 Rows and No in 2 row
    At the time of opening My page should display three buttons with title. On any event if i change second column value the number of button may change.
    if i add no of rows, no of buttons with title also get changed. Hence creation and display of button should be based on the no.of rows and column value.
    how to achieve it
    yours
    dr.s.raghunathan

    Hi,
    Begin
    for i in (select label,flag from button_table) loop
    if i.flag = 'Yes' then
    htp.p('<input type = "submit" value ="'||i.label||'">');
    end if;
    end loop;
    end;
    where button_table is ur table and label and flag are your columns

  • Conditionally display items based on null LOV value

    Hello,
    I've seen several examples that do what I'd like to do but with different implementations. Perhaps someone can steer me in the right direction...
    I have a pop-up lov that pulls a list of names from various places. If, however, the name cannot be found I'd like to display a few text boxes where the user can enter a new name.
    For my list of values I have configured the following:
    Display Null: Yes
    Null Return Value: -1
    Null Display Value: Not Found
    My HTML Form Element Attributes has: onchange="doSubmit()";
    My Source section has:
    Source Used: Only when current value in session state is null
    Source Type: Static Assignment (value equals source attribute)
    My entry text boxes have a condition specified:
    Value of Item In Expression1 = Expression 2
    Expression 1: P4_LOOKUP_NAME
    Expression 2: -1
    I also have an unconditional branch to this same page (Page 4) that sets the value of P4_LOOKUP_NAME to P4_LOOKUP_NAME.
    I cannot seem to get this item to display though...any thoughts?
    Thanks in advance for your suggestions!

    jhammer,
    I like the concept. This would require a custom popup lov - something that can be a little tricky/time consuming the first time around. The popup lov would probably have to create new entries via Ajax to be able to pass back the correct ID/display values to the parent window on close.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Display buttons based on some role

    I have user log into the app with some roles ex admin, user, manager etc. When they login, they come to a list page. there on the top of the page there is a button which will take to a report page. when you click on that button will take you to the report page where I have several buttons to run reports. Now I need to restrict user to view some buttons. example, admin can view all the buttons and run them. manager can run only some report and so does users. how can i do this easy way?
    Any sample, suggestion or help is appreciated.

    You could create a roles object that is basically an associative array, with the keys being the role name and the value being a number, like 1, 2, 3, 4, 5.
    Then test their access using the roles object using their role name, and only show that area of the UI if the value is >= the required number for that area of the UI.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

Maybe you are looking for

  • Logic Crashing - Please help me if you can!

    Hi guys First time posted; Long time browser.. Alright So I have Logic Pro with various AU instruments etc Its been going great for some time (months) and last two days Ive hit a bump. We tracked it down to being nexus; (au instrument) however even d

  • Can I alter the properties of an individual link on a HTML page without changing the other links?

    Hi there, I have a contact page created in Dreamweaver and have created an email link to launch Outlook when clicked on. However, all the links in my design have been set a certain way, i.e. white text knocked out of darker background. My email link

  • How to transfer files from Creative Zen Touch to Creative Vision:

    Is there a way to transfer my music files from my Creative Zen Touch to my Vision:M?If so, can someone tell me how to do this. ?I know this has probably been asked before but I am new on this message board and am in need of assistance. It would be gr

  • Opening maximized window from embedded flash movie

    Hi! I need your help! I have a html file with a flash movie-menu embedded into it. I'd like one of the buttons to open an external html page strictly in a new maximized window. It does not matter if the new window has toolbar or not. I want it to ope

  • Guest Server and LDAPS

    I've recently setup our NAC Guest Server and cannot get Secure LDAP to work. The config guide says you can use ldap://server or ldaps://server. When I use ldap://server it works but doesn't when I change it to ldaps. Our LDAP server has a Verisign ce