0
votes

Using Oracle APEX v4.2.2, I would like to dynamically build a checkbox selection list based on data from an Oracle Classic Report.

For example:

Location          Dept A.     Dept. B     Dept. C      Total Employees
----------------- ----------- ----------- ------------ ---------------
Paris             5           10          3            18

Using the above report, I would like to dynamically build three checkboxes based on the columns Dept. A, Dept. B and Dept. C

So beneath my report I would expect to see checkboxes:

[]Dept. A []Dept. B []Dept. C

Obviously if my report only returned just Dept. A then I would expect to see just one checkbox:

[]Dept. A

1

1 Answers

0
votes

Two ways to do it:

1) If the number of checkboxes are (a) known and (b) small, you can create each checkbox and make it conditional on an associated hidden page item (say :PXX_DEPTA_COUNT). Then you can have each of those hidden items either their value using 'Always / SQL Query', or they can be set all at once via a Page Process.

2) You can also create a PL/SQL dynamic content region, and use the apex.item API to create the checkboxes: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#AEAPI1006

If you go with the dynamic content region, you're going to have to do the HTML work yourself, but you can cheat by first creating a test region with some checkboxes laid out the way you want, then look at the page source and use the same HTML in your dynamic region.