Conditional display based on row count

I have a report region with sql query (PL/SQL function body returning sql query). In this region i have text item above the report. I would like to have a condition on this item that it should only show if there exists records in the report (row count > 0).
How can this be done?
Best regards
Erik

There are many options available for conditional display. You can use this one here:
http://apex.oracle.com/pls/otn/f?p=31517:7
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Conditional display based on Page Template

    I'd like to make some conditional display based on Page temlate value (definition). Example:
    return page_template='TABS';With such an feature it will be easy to exclude some elements defined on "Page 0" on some pages. I know that this could be done by enumerating page_id's...but in this way it will be much flexible...
    Is there such a feature? Will it be ever possible?

    A more flexible way (IMHO) to do this sort of thing would be to define onload application-level computations that set a application item to either SHOW or HIDE depending on the conditions you need. Then make the Page 0 components conditional upon this application item's value.

  • Conditional Display Based on a Field Value

    I'm a newbie ...
    I developed an application that shows payment information.
    Record type one is a cheque
    Record type two is a payment stub
    Rec Type Account Amount PDFFile
    1 888888 1234.00 summary.pdf
    2 888888 10.00
    2 888888 400.00
    2 888888 800.00
    2 888888 24.00
    I have developed a program that assimilates a number of cheque images into a single pdf file. I write the filename and location of that pdf file into a field on 'record type one' (cheque record).
    I want to have a button that only renders on records that that have a value in this field.
    I've looked at conditional display, but can't seem to find the right option.
    Can anyone get me pointed in the right direction?
    Thanks
    Dave

    Dave - Where do you "write" this field? On the same page or from a previous page? What is the display type of this field (which I hope is implemented as an Application Express page item)?
    It's all about having a value in session state for that page item at the time your button is rendered. If you've got that, then the button condition will be trivial.
    Scott

  • Conditional Display based on Function and Application Item?

    I have a function within my DB that checks if the STAFF_ID (an application level item) is a "Super User" within my application. The function ("is_super-user") returns 1 if the STAFF_ID given is a Super User. (I am not using ApEx users/groups)
    How would I call this function within the Conditional Display of a button?
    I tried the following with no luck... (although it does not give me an error)
    Conditional Type: PL/SQL
    Expression 1: is_super_user(&STAFF_ID.)=1

    Matt is that you? You're not makin it real easy to identify you by name...
    The function ("is_super-user") returns 1...
    That should be is_super_user (without quotes, of course).
    Your previous attempt should have produced an error. But this should work:
    Conditional Type: PL/SQL
    Expression 1: is_super_user(:STAFF_ID)=1
    ...assuming the function has a varchar2 input parameter.
    And then to make it secure, you'll want to make that application item Restricted so nobody can pass in a value from the page. This kind of condition is a good use of authorization schemes which you can name/create once and attach to all sorts of components throughout the app. Speaking of other components, you should protect DML processes using the same condition/authorization scheme because just because there is no button visible on the page doesn't mean someone can't put one there and submit the page anyway.
    Scott

  • Create a group based on row count

    I am looking for a way of reducing the size of tables I am displaying in my monthly report, by counting some rows together, and naming them 'other'
    I would like to always show all rows, where count of item is >= 50, but all rows where count of item < 50, total up and call 'other'.  I will add an example image as soon as my account has been verified
    I can hide rows using this in the visibility =iif(Count(Fields!Item.Value) >= 50, False, True)
    I have duplicated the line, and added a filter to each (one for greater than 50, one for less than 50) but my totals are still counting all the data, and not just the filtered data.
    Ideally, I would like to add a column using something like =iif(Count(Fields!Item.Value) >= 50, "Over50", "Under50"), or a group based on the same sort of idea, but I keep getting errors about using aggregates in columns.
    Any suggestions?
    Cheers

    What you can do is to add derived column in query behind like this
    SELECT other columns...,
    CASE WHEN Cnt >= 50 THEN YourGroupingField ELSE 'Other' END AS GrpName
    FROM
    SELECT *,COUNT(1) OVER (PARTITION BY YourGroupingField) AS Cnt
    FROM Table
    )t
    Then in your reports use =Fields!GrpName.Value as the Grouping column and you will get required output
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Conditional display in the row template!

    Hi,
    I created a report template and my report shows like this:
    col1 col2 col3 col4 col5
    a 4 5 6 7
    b 4 8 7 2
    Total 8 13 13 9
    I am able to display all the above, but the column name should be "Total" at the end of the report when i am displaying the totals. totals also coming from the database, so i am not calculating here.
    Shall i put any condition saying that if the col1 is null then col1 should display "Total".
    Please suggest.
    Thank you.

    manyam16 wrote:
    Actually I used the row template conditions to solve that. But I have added one more count in the database package, that column is coming into the report attributes, not showing in the report. any ideas?
    I am using like this #COL50#where are you using this? if you are using this in column conditions, it will not work
    thank you,

  • Conditional display of report row

    Hi All,
    I've a report form and have a LOV for a column. Based on the data selected in the LOV I need to populate some more rows to that report.
    It is basically like a survey page where depending on the answer provided by the user, sub suvery question needs to be populated. For example if I select "Married" for maritial status another question should be populated asking for Spouse Name. All the queries are stored in a same table with Parent question ID to link Child question to Parent Question.
    Any clue on how to do this.
    Thanks in advance
    Prasanth

    a. It is a report on table and one column is editable with a LOVThat is Tabular Form or Updatable report. Implies there is a ApplyMRU/ApplyMRD process to perform the update.
    >
    b. APEX 4.1
    >
    The solution will depend on your database design. You may need to review in the light of the page design you will do.
    I don't think I will get into the code for this as it will be fairly nifty and will require a study of your database design.
    At a high level:
    a. Create a table(s) for keeping your questions, say Questions.
    b. Next you need to decide how you want to store your "rules" for selecting questions based on prior responses. Rules may be built into the database design or external processing based on column(s) in the question rows.
    c. Create a table for Responses. Populate it with the mandatory questions.
    d. Base your Tabular form on the Responses table
    e. Each time a use makes a selection in a row's LoV submit the page to loop back on to itself.
    f. In OnSubmit processing, after the Responses table has been updated, add the relevant rows from your Questions table to the Responses table using your rules in a Page Process.
    h. When the Form is displayed again the new questions will be displayed as the corresponding rows have been inserted into the Responses table in the process referred to above.
    Of course, you will need to write some more code for situations where a user goes back and changes the Lov of a prior question that affects related questions....
    Cheers,

  • 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

  • Complex conditional display in report table

    Hi,
    I built a report in a region, and want to make one of the columns conditionally display based on attributes from two other columns in the table. The drop-down for the conditional display only lets me refer to the current item. Is there a way I can reference the other cells in that table row in a PL/SQL expression (e.g.: something akin to #COLB# is not null and #COLC#>1000 ?)
    Related question: I'm assuming the reason I can't directly change the source for the report region and can only modify it from the Query Definition tab is because I used a wizard to create it. Is there a way to "undo" this and make the source for the report fully editable? That would also solve the problem, since I could just add a function-derived column to the query.
    Thanks in advance,
    Keith

    One final update and rephrasing of the problem, because maybe there's another way to solve this.
    I have a column in a report that links to another page, but the link is only shown if a certain condition is met (which is based on other cells in this table row). I can test for those conditions in my original SQL query, so that a null value in my link column results in no user-clickable link being created. (I have to make sure that a null value appears as null on the report page, too.)
    This works fine if the link text is just that: text. Because not meeting the condition returns null, so no text == no link.
    Now the only problem I have comes if I want to use an icon (e.g.: the edit icon) instead of link text.
    What I really want is for the icon to only appear if a certain condition is met. However, the icon replaces the column value so I can no longer use a null value to prevent the link from appearing.
    The original question asked whether I can use other report cells (#foo#) in the conditional display for a cell. If that's not possible, any suggestions on how to achieve the desired effect without resorting to JavaScript?
    Thanks.
    Edited by: kswartz on Jun 20, 2009 1:56 AM

  • 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

  • Page display based on count of records

    Hi All,
    i have one report requirement in BIP.
    my report should contains 3 pages only.
    Fist page contains first contact information.
    Second page should contain Second contact inforamtion.
    Third page should contain comparing of first contact age and second contact age.
    if we select first contact record it should display first page contact info only no need to display compare page.
    if we select two contacts then it should display first contact page, second contact page and compare contact age page also. (here first contact and second contact columuns should match. example address, country but age not required to match)
    if we select three or more contacts they should get a message please select two contact records only message.
    Now my question is regarding to page displays, how can we count records then display first page, otherwise display all pages, else message. Here i want to generate report with sub template logic.
    Thanks,
    jag
    Edited by: user7498756 on Aug 30, 2012 8:45 AM

    as you were saying they will select the option so in your template
    use if condition based on user input to execute the block you need .
    if selected value = first member
    call subtemplate first part
    end if
    if selected value = second member
    call subtemplate second part
    end if
    if selected value = more than 2
    keep static message
    end if
    in subtemplate create
    2 parts of code
    first part
    will have first page logic
    second part will have
    its logic required

  • Displaying rows with reference to row count.

    Situation :
    I am trying to display data which are or of 820 rows by default.
    When user select some data , I will display some data but if he not selecting any data then it is displaying all 820 rows.
    So i used a count option where i wrote a code
    <?choose:?><?when:count(_Company_Prompt_._PL_Unit_Number_and_Name_-Prompt)=820?><?'ALL'?><?end when?><?otherwise:?><?_Company_Prompt_._PL_Unit_Number_and_Name_-Prompt?><?end otherwise?><?end choose?>
    for the field count CompanyPrompt_._PL_Unit_Number_and_Name_-Prompt
    But it works fine if i dont use repeating group but that no use because it will show all for report defaults but when user select more than one , it still display only one row.
    i am try to use same code with F <?for-each:PARAMETER_FOR_BUSINESS_UNIT_ROW?> E
    The code for f is <?for-each:PARAMETER_FOR_BUSINESS_UNIT_ROW?>
    the code for <?for-each:PARAMETER_FOR_BUSINESS_UNIT_ROW?> is given above
    the code for e is <?end for-each?>
    how can I fix this,
    Thanks
    Aj

    I don't quite understand your requirement clearly as stated, I am guessing that you are using a dashboard prompt and your answers request is filtered based on the prompt.
    Based on the default value, all rows are returned, and if the user selects some value from the prompt, data is filtered.
    Within the template, if the count is equal to 820 then you want to show the text 'ALL' otherwise show all rows?
    you could try the following: Declare a variable like so:
    <?variable:myvar;count(_Company_Prompt_._PL_Unit_Number_and_Name_-Prompt)?>
    then check if this variable value is equal to 820 then print the text 'ALL' or do your regular logic..
    <?choose:?>
    <?when:$myvar=820?><?'ALL'?>
    <?end when?>
    <?otherwise?>
    <? other logic?>
    <?end otherwise?>
    <?end choose?>
    You can also use two templates within the main RTF and call them as appropriate based on the count check.
    Hope this helps. Sorry if I misunderstood your requirements.

  • Conditional Display of Interactive Report Based on Field Above

    Page one has simple text box entry for a Vendor # with a button that branches to a page displaying information for that vendor. In a region below, I would like an interactive report that displays all of the item and description that vendor provides to our company. I have tried to use the Conditional Display to disply only items in the report but have been unsuccessful. Your help is appreciated!
    Thanks.

    Hello user2961006 (please tell us your name),
    I understand your question to be, "how do I make a report on page two only show rows related to an item entered on page one". Putting a condition on a region isn't the answer here - you want the report to always display, but just with different rows depending on the vendor number entered. A condition on a region is used to either display the region or not.
    What you need to do is put a WHERE clause on the SELECT statement that your report is using to get its data. For example, if the item holding the entered vendor number is P1_VENDOR_NUM, the SELECT statement for your report would look something like:
    SELECT item, description
      FROM my_items
    WHERE vendor_num = :P1_VENDOR_NUMNote my_items is a fictitious name. This will tell the DB to only retrieve rows where the vendor number is the vendor number entered by the user.
    Hope this helps, I'll gladly accept reward points if it does ;-)
    John

  • OVS display row counts

    Hi,
    When i search for records via OVS and display, i want to set the display row count to 5 rows. I donot find an option within OVS auto generated code to set it. Is there any way to do that ?
    Thanks in advance,
    Gaurav.

    Hi,
    Under phase indicator,
    In Case if_wd_ovs=>co_phase_0,
          ovs_callback_object->set_configuration(
                    window_title = lv_group_header
                    col_count    = 3
                    row_count    = lv_line ). Hre u can mention the no. of rows to be displayed.
    Thanks,
    Divya.S

  • Get user count from two tables and display in 1 row

    I have 2 tables.....
    Table1 Table2
    user date user date
    With 1 query, I want to display the user, the count of the number of times a user appears in Table1.user as count1 and the count of the number of times that same user appears in Table2.user as count2 between a specific time period. I have looked and tried things including joins, unions, nested loops but can't get anything to work. The result would appear like this:
    USER COUNT1 COUNT2
    john 100 2
    doe 1000 200
    Thank you for your time. I'm really stuck and confused.

    Hi,
    Welcome to the forum!
    I think the easiest way to do this is to do a GROUP BY query on each table separately, and then combine the results, using FULL OUTER JOIN or UNION.
    WITH     union_data     AS
         SELECT       user_name
         ,       COUNT (*)     AS count1
         ,       0              AS count2
         FROM       table1
         WHERE       dt     >= &start_dt
         AND       dt      <  &end_dt + 1
         GROUP BY  user_name                             -- Forgot this originally!
    UNION ALL
         SELECT       user_name
         ,       0              AS count1
         ,       COUNT (*)     AS count2
         FROM       table2
         WHERE       dt     >= &start_dt
         AND       dt      <  &end_dt + 1     
         GROUP BY  user_name                             -- Forgot this originally!
    SELECT       user_name
    ,       SUM (count1)     AS count1
    ,       SUM (count2)     AS count2
    FROM       union_data
    GROUP BY  user_name
    ;Edited by: Frank Kulash on Jul 29, 2009 1:34 PM
    Edited by: Frank Kulash on Jul 29, 2009 2:46 PM
    As Solomon pointed out, I forgot the GROUP BY clauses in the sub-query.
    Without the tables, I can't test it.

Maybe you are looking for

  • Problem while using dynamic geo characteristic on a map

    Dear all, I'm not able to display dynamic geo characteristics on a map though I am able to display static geo chars on a map. I have done the following: - Define the characteristic as dynamic geo characteristic. - Download the Geo data from the char

  • Finder not loading since upgrading to Yosemite

    Hi Everyone, I have a 2012 Macbook Pro 15" model. Intel Core i7 processor and 8GB RAM. I upgraded to OS X Yosemite yesterday from 10.8 and since then, I've been experiencing longer boot times, Finder not loading my local files and folders, Launchpad

  • Spell checking dont working with "Automatic by language" option

    Russian spell checking dont working with "Automatic by language" option in Sys. prefs.

  • IPrint Profile - Hold Print help?

    We are using iPrint (2.1.3). We are using RICOH copiers as printers/scanners and having issues with creating a Printer Profile to set Hold print as a default. This is proving problematic. When the profile is created, we set a User Name (tried both 'T

  • Demo iTouch

    I would like to demo the iTouch in front of a group. I would like to display the iTouch on a projector for the audience to see. I can see there is VNC client software for the iTouch, but no VNC Server software for the iTouch. I really don't want to '