34
Tweaking APEX: A New Approach for Dynamic Interactive Reports Dr. Eckhart Guthöhrlein (Roche Diagnostics GmbH) Dr. Bernhard Schirm (quattro research GmbH) [email protected] [email protected]

Tweaking APEX: A New Approach for Dynamic Interactive Reports

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Roche TemplateDr. Eckhart Guthöhrlein (Roche Diagnostics GmbH) Dr. Bernhard Schirm (quattro research GmbH)
[email protected]
[email protected]
Motivation
o without programming knowledge
o Excel Export
• Ways to extend APEX
o JavaScript (see yesterday’s presentation by C. Qu & A. Kohn)
o APEX API
• Founding families still hold majority stake
• Employing 80,000 people
• Leadership in pharmaceuticals
market leader in virology
• Focus on Personalized Healthcare
Divisions: Pharma & Diagnostics
1998 acquired by Roche
Pharma Research & Early
(Oncology, Inflammation, CNS, Virology)
* Headcount of December 2011
in Biologics Research, DOAG BI 2013
Available Tools
12
Roche
• Missing APEX functionality
o Report generator
14
Implementation
15
• graphical UI
• create View and MView
• APEX API
• APEX tables
• graphical UI
• create View and MView
• APEX API
• APEX tables
• graphical UI
• create View and MView
• APEX API
• APEX tables
Report column
Process info
General data
Online values
Offline values
SQL statements
select distinct
,bbrh."CO2 basal flow SP (ml/min)" as "r10243"
,bbrh."temperature SP (°C)" as "r10244"
,ovd26073.fact_value_num as "o10245"
,ovd26074.fact_value_num as "o10246"
from h$v_eucaryote_base bv
left join mv_offline_results ovd26073 on ovd26073.parameter_fk=377 and ovd26073.object_fk=bv.object_pk
left join mv_offline_results ovd26074 on ovd26074.parameter_fk=377 and ovd26074.object_fk=bv.object_pk;
Database code
avoid 30 character limit &
camel case (pH -> Ph)
• create materialized view => Performance!
' build deferred as select * from ' || l_view_name;
-- refresh mview async by using a job
DBMS_SCHEDULER.create_job(job_name => 'REFRESH_' || to_char(p_ReportPK),
• graphical UI
• create View and MView
• APEX API
• APEX tables
• Proper date and number formatting
• Freeze headers & columns
• “Real” Excel export
26
from v_Report_Item r where r.report_pk = p_ReportPK) loop if rec.significant_digits is not null and rec.significant_digits > 0 then update apex_access.wwv_flow_worksheet_columns set format_mask = NUMBER_FORMAT_MASK || rpad('D', rec.significant_digits + 1, '0') where flow_id = p_app_id and page_id = p_page_id and db_column_name = rec.col_name and column_type = 'NUMBER'; end if; end loop;
27
update apex_access.wwv_flow_worksheet_columns
• add tooltips via JavaScript column links
28
• extends menu using JavaScript
$v('APEXir_REPORT_ID')
$v('pFlowStepId')
o underlying query becomes inner SELECT statement
o the user‘s column selection become the outer SELECT statement, preserving
column ordering
o filters and searches are parsed into a WHERE clause
2. Set column labels using a hash table with the corresponding column
names.
3. Build Excel XML and return it as a BLOB
o Extensions to PL/SQL “Excel creator“ by Anton Scheffer1
31
1http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql
-- queries of all IRs in application 248 select to_char(ir.sql_query) sql_query,
page_id,
ir.interactive_report_id
from apex_application_page_ir ir
join apex_application_page_ir_col col
select condition_column_name,
35
[email protected]
[email protected]