Donnerstag, 24. November 2011

Pimp the Interactive Report...

I like the interactive Report much more then the Tabular form, but now I want to add some functionality to the Interactive Report on Page 3. I would like to implement a multi record delete button. First I have to be able to select multiple in the interactive report. The best way to achieve this is to select the function apex_item.checkbox2.

Our query has to look like this

SELECT apex_item.checkbox2 (1,runid) AS chk,
  runid ,
  related_run ,
  run_owner ,
  run_date ,
  run_comment ,
  run_total_time ,
  '>div style="width:100px;height:14px;background:#cccccc;border-top:1px solid #aaaaaa;border-left:1px solid #aaaaaa;border-bottom:1px solid #ffffff;border-right:1px solid #ffffff;"<>img src="/i/1px_trans.gif" width="'
  || ROUND((run_total_time * 100) / max_run_total_time, 0)
  || '" alt="40" height="14" border="0" style="background:#777777;"<>/div<' AS graph
  (SELECT r.runid ,
    r.related_run ,
    r.run_owner ,
    TO_TIMESTAMP(TO_CHAR(r.run_date, 'DD.MM.YYYY HH24:MI:SS'), 'DD.MM.YYYY HH24:MI:SS') AS run_date ,
    r.run_comment ,
    r.run_total_time ,
    (SELECT MAX(run_total_time) FROM plsql_profiler_runs
    ) AS max_run_total_time
  FROM plsql_profiler_runs r

change the "Display Text As" of the new Chk item to "Standard Report Column" and reorganize the columns of the report and you will achieve this result.

run the query in sqldeveloper (or something similar) and you will get this output for record 1 column chk

<input type="checkbox" name="f01" value="3"  />

youn will find the same code with firebug to.

Keine Kommentare:

Kommentar veröffentlichen