3 Replies Latest reply: Mar 25, 2010 6:06 PM by AmandaWalsh RSS

    how to set a condition for a column in a sql report oracle apex

    567616
      Hi All

      I am trying to create a sql query based report in apex3.1, then I need to put a condition for one of the column and make it to be shown on the report when the value is not null, otherwise don't show.

      Does anyone knows how to reference a column in report attributes Tab--> condition ?

      thanks
        • 1. Re: how to set a condition for a column in a sql report oracle apex
          AmandaWalsh
          Hi,

          Edit the report, and go to the "*Report Attributes*" tab.

          Then you need to Click on the Edit icon of the COLUMN that you want to be conditional.

          There is a region here called "*Conditional Display*" where you can set the column conditions.
          You can use the "*Value of Item in Expression 1 is NOT NULL*" option to base the columns conditions depending on whether a Page or Application item is not null.


          Note: when using this option, the item name needs to be entered without the colon ":"
          Correct:
          P1_ITEM_NAME
          Incorrect:
          :P1_ITEM_NAME
          Amanda.
          • 2. Re: how to set a condition for a column in a sql report oracle apex
            567616
            Hi Amanda

            Thanks for your response, if I want to use one of the report column for the condition item instead of P1_itemName, do I need to use #ReportItemName# ?

            thanks
            • 3. Re: how to set a condition for a column in a sql report oracle apex
              AmandaWalsh
              Hmm I don't think this is something that you could do, the reason being that if you were referencing the report column, this would not return one value, but have a different value for each record.

              If you wanted another column's data visible based on the value of another, by a row-by-row basis, this would be something you would control in the SQL using a CASE statement.

              In the case that you may always only be displaying one record of the report, you could create a page item, and then populate this item using a SQL query that returns the value of the column.

              Maybe if you give us some more specific examples of what you are trying to achieve, suggestions could be provided for alternative ways to accomplish the task.

              Amanda.