5 Replies Latest reply on Jan 23, 2013 3:08 PM by NewApexCoder

    Report checkboxes and exporting

    NewApexCoder
      Greetings

      I am using Apex 4.2. I have a two part question
      I have a simple report I've generated. When the report is generated, I want each row to have a checkbox on the side of it and to set the value of the checkbox to "true". So the checkbox should already be checked upon being generated. Having some trouble accomplishing this

      Also...

      I know how to export the report to either a pdf or .csv file, however, I want the user to be able to uncheck certain rows that they don't want to include in the report. Can you place a conditional on the report export button/link? As to say, export only those that are checked? Just not sure where to place the conditional statement.

      Thanks in advance!
        • 1. Re: Report checkboxes and exporting
          Bas de Klerk
          Hi,

          first part :
          Use a query like this to have them checked:
          select apex_item.checkbox(1,A.ID,'CHECKED') CHECKBOX, A.*, rownum from <<table_name>> A;
          Use a query like this to have them UNchecked:
          select apex_item.checkbox(1,A.ID,'UNCHECKED') CHECKBOX, A.*, rownum from <<table_name>> A;
          By default it is not possible to exclude rows from the standard export in a report.
          You can always create a manual export but this takes some work, assuming you are using a standard report this is fairly easy, if you are using an interactive report this takes more effort ( but is also possible ).
          I would start of to see if you can find a way to use the standard export, otherwise if this is not possible and you need more info on the export let me know.

          regards
          Bas

          Edited by: Bas de Klerk on 22-jan-2013 9:08
          • 2. Re: Report checkboxes and exporting
            NewApexCoder
            I tried using the suggested query, however, something isn't right. I get all the columns I need plus a column named 'CHECKBOX' that has
            <input type="checkbox" name="f01" value="8" CHECKED />
            in it for each row. Not sure whats going on.

            As for the second part, I may be able to produce a desired pdf export with a conditional clause via to only give the rows that are checked
            • 3. Re: Report checkboxes and exporting
              NewApexCoder
              I have tried going into my application and editing the report attributes. Under one of my report columns, for the column attributes, I changed the "Display As" field to 'Simple Checkbox. This gives me a checkbox, but now I am not sure where to set those boxes to be checked. Not sure where to set the value = 'True' at.
              • 4. Re: Report checkboxes and exporting
                Bas de Klerk
                Hi,

                make sure the checkbox column is of type "Standard report column", then you get the checkbox derived from the query.

                Cheers
                Bas
                • 5. Re: Report checkboxes and exporting
                  NewApexCoder
                  I have made sure. I have also found another solution in how to generate a checkbox within the query.
                  select 'Y' AS <column name>, A.this, A.that
                  from <table name>
                  where <condition>
                  making the first column name as a checkbox type will generate a checkbox that is already checked.

                  Using
                   select 'N' AS <column name> 
                  also generates the check boxes but as unchecked