51
1.1 Hooked on Classic (Reports) Hooked on Classic (Reports) Learn tips & techniques to make them sing Learn tips & techniques to make them sing Jorge Rimblas

Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

1 . 1

Hooked on Classic (Reports)Hooked on Classic (Reports)Learn tips & techniques to make them singLearn tips & techniques to make them sing

Jorge Rimblas

Page 2: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

1 . 2

Jorge RimblasJorge RimblasSenior APEX Consultant

@rimblasrimblas.com/blog

Oracle DB since 1995APEX since it was HTMLDB in 2004Always involved in web technologiesjrimblas in OTN Forums

Co-author of"Expert Oracle Application Express, 2nd Edition"with "Themes & Templates" chapter

Page 3: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

1 . 3

Age: 13 years!Staff: 80+ employees68 consultants/developers2015: 60% GrowthAPEX Solutions: 12 Years!Largest APEX practice in North AmericaOracle Center of Excellence

Page 4: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

2 . 1

AgendaAgendaWhy?Template TypesGeneric Column Templates

Analytic FunctionsLimitationsResources

Named Column Templates

Page 5: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

2 . 2

Final Slides AvailableFinal Slides AvailableAfter The PresentationAfter The Presentation

Page 6: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

3 . 1

Why?Why?Standard FunctionalityStandard Functionality

Ease of useEase of useFlexibilityFlexibility

Page 7: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

3 . 2

Page 8: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

3 . 3

Page 9: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

4 . 1

TemplateTemplateTypesTypes

Page 10: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

4 . 2

Generic ColumnsGeneric Columns&&

Named ColumnsNamed Columns

Page 11: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

4 . 3

Generic Columns

Named Columns

Column TemplateColumn Template

Row TemplateRow Template

Page 12: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

4 . 4

Page 13: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 1

GenericGenericColumnsColumns

Page 14: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 2

Every column looks the same Every column looks the same <td> #COLUMN_VALUE#</td>

Page 15: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 3

Every column looks the same Every column looks the same <td class="t-Report-cell" #ALIGNMENT# headers="#COLUMN_HEADER_NAME#"> #COLUMN_VALUE#</td>

Page 16: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 4

Column Template ConditionsColumn Template ConditionsFour Column TemplatesCondition for each templateCondition types: PL/SQL Expression, even or oddrows

Page 17: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 5

Using conditionsUsing conditions

Page 18: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 6

Duplicate the templateDuplicate the template

Page 19: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 7

Modify the templateModify the template

Page 20: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 8

Assign the templateAssign the template

Page 21: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

5 . 9

Step by step detailsStep by step detailsrimblas.com/blog/2014/05/using-conditions-with-column-templates/

Page 22: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 1

NamedNamedColumnsColumns

Page 23: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 2

SQLSQL Named ColumnsNamed Columnsselect PRODUCT_ID , PRODUCT_NAME , PRODUCT_DESCRIPTION , CATEGORY , PRODUCT_AVAIL , LIST_PRICE from PRODUCTS

#PRODUCT_ID##PRODUCT_NAME##PRODUCT_DESCRIPTION##CATEGORY##PRODUCT_AVAIL##LIST_PRICE#

Page 24: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 3

Simple ListSimple List

Page 25: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 4

Simple ListSimple List<ul> <li>Orange Juice <i class="fa fa-check-square-o"></i></li> <li>Milk <i class="fa fa-check-square-o"></i></li> <li>Eggs <i class="fa fa-square-o"></i></li> <li>Bread <i class="fa fa-square-o"></i></li> <li>Cornflakes <i class="fa fa-square-o"></i></li></ul>

<li>#TODO# <i class="fa fa-#CHECKED#square-o"></i></li>

<ul>

</ul>

Before Rows

After Rows

Page 26: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 5

Simple List TemplateSimple List Template

Page 27: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 6

Simple ListSimple List <li>#TODO# <i class="fa fa-#CHECKED#square-o"></i></li>

select id , todo , decode(completed_by , null, '' , 'check' || '-') checked , completed_by , completed_onfrom app_todos

Demo p220

Page 28: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 7

DemoDemoAdding a link to edit

Page 29: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

6 . 8

BenefitsBenefitsStandard Classic Report Functionality

Edit LinksDynamic Actions

Dialog CloseRefresh

Page 30: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 1

NamedNamedColumnsColumnsMixing LayoutsMixing Layouts

Page 31: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 2

Contact ListContact List

Page 32: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 3

Two types of rowsTwo types of rows

<tr> <td colspan="2"> <a href="#LINK#">&EDIT_BUTTON.</a> #PARTY_NAME# - #ROLE# <i class="fa"></i> </td></tr>

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

Page 33: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 4

<tr> <td colspan="2"> <a href="#LINK#">&EDIT_BUTTON.</a> #PARTY_NAME# - #ROLE# <i class="fa"></i> </td></tr>

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

select party_id , party_name , role , type_name , entry , active_ind from parties

Page 34: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 5

<tr> <td colspan="2"> <a href="#LINK#">&EDIT_BUTTON.</a> #PARTY_NAME# - #ROLE# <i class="fa"></i> </td></tr>

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

select party_id , party_name , role , type_name , entry , active_ind from parties where party_id = 41

For a single rowFor a single rowOr the 1st Party RowOr the 1st Party Row

Use Use bothboth types of rows types of rows

Special Case

Page 35: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

7 . 6

Page 36: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 1

AnalyticAnalyticFunctionsFunctions

Page 37: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 2

Analytics SyntaxAnalytics Syntax<function> (<arg1>, <arg2>, ) OVER ( < partition clause > < sorting clause > < windowing clause > )

row_number() over ( partition by party_id order by party_name, entry )

Page 38: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 3

AnalyticsAnalyticsselect party_id , party_name , entry , row_number() over ( partition by party_id order by party_name, entry) rn from parties

PARTY_ID PARTY_NAME ENTRY RN--------- ------------------ -------------------------------- -------1 Scott, Michael 800 555-1212 11 Scott, Michael 952 555-1212 21 Scott, Michael [email protected] 321 Schrute, Dwight 800 555-1212 121 Schrute, Dwight [email protected] 221 Schrute, Dwight [email protected] 341 Halpert, James D. 800 555-1212 1

7 rows selected.

Page 39: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 4

count(*) as analyticcount(*) as analyticselect party_id , party_name , row_number() over ( partition by party_id order by party_name, entry) rn , count(*) over ( partition by party_id ) total_rows from parties

PARTY_ID PARTY_NAME RN TOTAL_ROWS--------- ------------------ --- -----------1 Scott, Michael 1 31 Scott, Michael 2 31 Scott, Michael 3 321 Schrute, Dwight 1 321 Schrute, Dwight 2 321 Schrute, Dwight 3 341 Halpert, James D. 1 1

7 rows selected.

Page 40: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 5

KISS series on AnalyticsKISS series on Analyticsby Connor McDonald

youtu.be/nk4I4ta4ZuU

Page 41: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

8 . 6

select party_id , party_name , role , type_name , entry , row_number() over (partition by party_id order by party_name, entry) rn from parties

:RN = 1

Page 42: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 1

Putting it all togetherPutting it all together

Page 43: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 2

Create a new templateCreate a new template

Page 44: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 3

<tr> <td colspan="2"> <a href="#LINK#">&EDIT_BUTTON.</a> #PARTY_NAME# - #ROLE# <i class="fa"></i> </td></tr>

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

Column Template 1 Column Template 2

Page 45: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 4

<tr class="newContact rowStatus_#ACTIVE_IND#"> <td colspan="2" class="t-Report-cell heading"> <a href="#LINK#" class="contactEdit" data-id="#PARTY_ID#">&EDIT_BUTTON.</a> <span class="name">#PARTY_NAME#</span> - <span class="roleName">#ROLE#</span> <i class="fa cfa-check_#ACTIVE_IND# cfa-1_5x" title="#ACTIVE_IND#"></i> </td></tr><tr> <td align="right" class="t-Report-cell contactType">#TYPE_NAME#</td> <td class="t-Report-cell contactEntry">#ENTRY#</td></tr>

<tr> <td colspan="2"> <a href="#LINK#">&EDIT_BUTTON.</a> #PARTY_NAME# - #ROLE# <i class="fa"></i> </td></tr><tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

Column Template 1

Adding some markup

Page 46: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 5

<tr> <td align="right">#TYPE_NAME#</td> <td>#ENTRY#</td></tr>

Column Template 2

Page 47: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

9 . 6

Contact ListContact List

Page 48: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

10

ReferencesReferencesDemo App

KISS Analytics

apex.oracle.com/pls/apex/f?p=89361rimblas.com/blog/2014/05/using-conditions-with-column-templates/

youtu.be/nk4I4ta4ZuU

Page 49: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

11

Q&AQ&ATemplate OptionsTemplate Options

Power OptionsPower OptionsJorge Rimblas

@rimblas

Page 50: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

12 . 1

Page 51: Hooked on Classic (Reports) - Amazon S3 · 1.1 Hooked on Classic (Reports) Learn tips & techniques to make them sing Jorge Rimblas

12 . 2

Your one stop for everything APEX

apex.world