slide1 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Introduction PowerPoint Presentation
Download Presentation
Introduction

Loading in 2 Seconds...

play fullscreen
1 / 69

Introduction - PowerPoint PPT Presentation


  • 312 Views
  • Uploaded on

Introduction. Authors: Francis Mariani – Francis Mariani.com (Canada) Susannah Jones – Consultant (United States) Anthony Alsford – EDATA Limited (United Kingdom) Presentation Title: Coding Standards for WebFOCUS Development Abstract:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Introduction' - nadda


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

Authors:

    • Francis Mariani – Francis Mariani.com (Canada)
    • Susannah Jones – Consultant (United States)
    • Anthony Alsford – EDATA Limited (United Kingdom)
  • Presentation Title:
    • Coding Standards for WebFOCUS Development
  • Abstract:
    • The Three Virtuosi from three countries, Francis, Susannah, and Anthony, combine their near-century of experience to -
    • 'Standards in Coding: Structure, Clarity, & Simplicity’.
slide3

Introduction

Designing the program

Presentation Layer

Maintainable Code

Questions

slide4

6. Passing the baton.

7. Modular / Reuseable code.

8. Consistent definitions.

9. Simplifies maintenance.

10. Speed of development.

TOP 10 REASONS FOR STANDARDS IN CODING

slide5

1. @@@@@@@@@@@@@@@@@@@@@@@

2. Big emergency?

Flip a switch, avoid a meltdown

3. Quick fix?

Might actually work

4. Major overhaul?

Instantly envision the whole thing

5. User confidence soars when your site is consistent.

TOP 10 REASONS FOR STANDARDS IN CODING

slide6

Fex construction

  • 0. dictionary
  • 1. environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • maintainable code
slide7

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

slide8

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

as short as possible

slide9

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

slide10

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

slide11

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

● list the measures

slide12

Fex construction

  • 0. dictionary
  • 1. environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • maintainable code
slide13

use &FEXNAME in usage logs, &FEXNAMEand &EDITDATE in report footings

for ‘ALL’ values of a variable, use ‘FOC_NONE’, or ‘$*’IF SEASON IS FOC_NONEreturns all valuesnb: SEASON is /A1, so $* is too wide; $* not for numbers

Lower case, more readable

drill-down fexes

1. environment variables

● initialize parameters

One, 1, comment line at top, documentation at the end !

slide15

● line up the equal signs !!!

but never use TAB key

Use 0and1for booleans, not ON and OFF, or YES and NO

slide16

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2.resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • maintainable code
slide17

2. resource allocation

● use input parameters for data directories

USE D:\IBI\APPS\&DIV|\INVENTORY.FOC D:\IBI\APPS\&CUST|\ORDERS2007.FOC AS ORDERS D:\IBI\APPS\&CUST|\ORDERS2006.FOC AS ORDERS\\servername\d$\IBI\APPS\&CUST|\ORDERS2005.FOC AS ORDERSENDFILEDEF DECODEDV DISK &servername|IBI\APPS\DECODEDV.FTM

slide18

2. resource allocation

● use input parameters for data directories

USE D:\IBI\APPS\&DIV|\INVENTORY.FOC D:\IBI\APPS\&CUST|\ORDERS2007.FOC AS ORDERS D:\IBI\APPS\&CUST|\ORDERS2006.FOC AS ORDERS \\servername\d$\IBI\APPS\&CUST|\ORDERS2005.FOC AS ORDERSENDFILEDEF DECODEDV DISK &servername|IBI\APPS\DECODEDV.FTM

● make report headers from input parameters use a decode file

-DEFAULT &DIV = ‘DR’;FILEDEF DECODEDV DISK D:\IBI\APPS\DECODEDV.FTM-RUN-SET &headerdiv = IF &DIV IS ‘ALL’ THEN ‘all divisions’ - ELSE DECODE &DIV(DECODEDV);-TYPE &|headerdiv = &headerdiv&headerdiv = Dresses Division

slide19

What’s a decode file?Take a look at the EDUCFILE… see how COURSE_NAME is repeated?

Make a DECODECC file

with a code snippet…

TABLE FILE EDUCFILE

SUM

COMPUTE BLANK/A1 = ' ';

COMPUTE NAME/A32 = ''''| COURSE_NAME || '''' ;

BY COURSE_CODE

ON TABLE SAVE AS DECODECC

END

slide20

2. resource allocation

● use input parameters for data directories

USE D:\IBI\APPS\&DIV|\INVENTORY.FOC D:\IBI\APPS\&CUST|\ORDERS2007.FOC AS ORDERS D:\IBI\APPS\&CUST|\ORDERS2006.FOC AS ORDERS \\servername\d$\IBI\APPS\&CUST|\ORDERS2005.FOC AS ORDERSENDFILEDEF DECODEDV DISK &servername|IBI\APPS\DECODEDV.FTM

● make report headers from input parameters

FILEDEF DECODEDV DISK D:\IBI\APPS\DECODEDV.FTM-RUN-SET &headerdiv = IF &DIV IS ‘ALL’ THEN ‘all divisions’ - ELSE DECODE &DIV(DECODEDV);

● make filters from input parameters

-SET &FILTERDIV = IF &DIV IS ‘ALL’ THEN ‘ ‘ ELSE- ‘IF DIV IS ‘ | &DIV ;

slide21

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2. resource allocation
  • 3.JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • maintainable code
slide22

3. JOINs

● Clear your joins before making new ones; its just a good habit

JOIN CLEAR *● Label your joins JOIN KEY IN host TO KEY IN guest AS JPROD to refer to them specifically,

to clear when necessary JOIN CLEAR JPROD● Use TAG syntax when duplicated field names occur across files

it allows you to use syntax as in SQL T1.[fieldname]JOIN KEY IN INVENTRY TO KEY IN PRODUCT TAG T1 AS JPROD END TABLE FILE SUM ….BY INVENTRY.prod_no BY PRODNAME…or

TABLE FILE INVENTORY SUM ….BY T1.inv_no BY PRODNAME

slide23

3. JOINs

● Use TAG syntax when joining twice

FIELD=SHIP_CODE,.. $

FIELD=SHIP_FROM,.. $

FIELD=SHIP_TO, .. $. . .

FIELD=SHIP_CODE, .. $

FIELD=CUSTOMERNAME,.. $

FIELD=ADDRESS, .. $. . .

JOIN SHIP_FROM IN host TO SHIP_CODE IN guest TAG T1 AS JCUST1 JOIN SHIP_TO IN host TO SHIP_CODE IN guest TAG T2 AS JCUST2 END TABLE FILE host PRINT SHIP_FROM T1.CUSTOMERNAME

SHIP_TO T2.CUSTOMERNAME

slide24

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • maintainable code
slide25

4. DEFINEs

● Clear your DEFINES not quite as important

JOIN statements clear DEFINE statements DEFINE FILE fn CLEAR DEFINE FILE fn ADD

SET KEEPDEFINES ON

except…

DEFINE FILE HOLD

. . . END

TABLE FILE HOLD . . .

ON TABLE HOLD

END

...

These DEFINEs will still apply to this HOLD file

slide26

4. DEFINEs

● lowercase DEFINE FILE CAR

icost/D8 = IF COUNTRY EQ ‘FRANCE’ THEN COST * &exrate ELSE COST ;

COGS/P11M = icost * SALES ; MN6/A6 = F_MN6('200705');

END

slide27

4. DEFINEs

● lowercase DEFINE FILE CAR

icost/D8 = IF COUNTRY EQ ‘FRANCE’ THEN COST * &exrate ELSE COST ;

COGS/P11M = icost * SALES ; MN6/A6 = F_MN6('200705');

END● UPPERcaseCOGS/P11M = icost * SALES ;

slide28

4. DEFINEs

● lowercase DEFINE FILE CAR

icost/D8 = IF COUNTRY EQ ‘FRANCE’ THEN COST * &exrate ELSE COST ;

COGS/P11M = icost * SALES ; MN6/A6 = F_MN6('200705');

END● UPPERcaseCOGS/P11M = icost * SALES ;

● define business rules in FUNCTIONs , put in edasprofDEFINE FUNCTION F_MN6(YYM/A6)

yy1/A2 = EDIT(YYM,'$$99');

month/A2 = EDIT(YYM,'$$$$99');

mn3/A3 = DECODE month(01 Jan 02 Feb 03 Mar 04 Apr 05 May 06 Jun

07 Jul 08 Aug 09 Sep 10 Oct 11 Nov 12 Dec ELSE ' ');

F_MN6/A6 = mn3 | ' ' | yy1 ;

END

MN6/A6=F_MN6('200705'); - - -> May 07

slide29

#0. dictionary

● list the dimensions that describe your business ● stabilize the nomenclature

● list the measures

slide30

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5.data extract(s)
  • presentation layer
  • maintainable code
slide31

5. EXTRACT

● filters in the first phaseTABLE FILE CAR

&FILTERCAR

&FILTERCNTRY

&FILTERSEATS

SUM SALES BY COUNTRY BY CAR

ON TABLE HOLD

12-character name limit

went away!

● the interim HOLD file, name it something other than HOLDTABLE FILE CAR

&FILTERCAR . . .

SUM SALES BY COUNTRY BY CAR

ON TABLE HOLD AS HCAR1

END

TABLE FILE HCAR1

SUM SALES BY

ON TABLE HOLD AS HCAR2

END

-RUN

slide32

5. EXTRACT

● lowercase for branching, easier to separate from the true body of your logic.

TABLE FILE CAR

SUM

-GOTO by.&BYFIELD ;

-by.COUNTRY

BY COUNTRY AS ‘manufacturing country’

-GOTO by.end ;

-by.CAR

BY CAR AS ‘car’

-GOTO by.end ;

-by.end

ON TABLE. . .

END

-RUN -IF &FOCERRNUM NE 0 THEN GOTO . . .● check for compile errors after every paragraph , and handle… so that your fex doesn’t continue, and process incorrectly.

slide33

5. EXTRACT

Readability:

Its all about readability.

Next year when you go back to look at your fex,

the more readable you’ve made it,

the faster you’ll remember what you did .

● align your AS phrases:

SUM

FIELDONE AS ‘some nice label’

FLDTWO AS ‘some other label’

slide34

5. EXTRACT

Readability:

Its all about readability.

Next year when you go back to look at your fex,

the more readable you’ve made it,

the faster you’ll remember what you did .

● align your AS phrases:

SUM

FIELDONE AS ‘some nice label’

FLDTWO AS ‘some other label’

● separate lines for fieldnames, easier to count columns for your compute statements.

SUM

FIELDONE AS ‘some nice label’

FLDTWO AS ‘some other label’

FLD3 AS ‘some nice title’

COMPUTE FLD4/I8=C1+C2+C3; AS ‘nice summary’

slide35

5. EXTRACT

● conditional display:

-SET &field1np = IF … THEN ‘ ‘ ELSE ‘ NOPRINT ‘;

-SET &fieldtwonp = IF … THEN ‘ ‘ ELSE ‘-*’;

SUM

FIELDONE AS ‘some nice label’ &field1np

&fieldtwonp.EVAL FLDTWO AS ‘some other label’

slide36

5. EXTRACT

● conditional display:

-SET &field1np = IF … THEN ‘ ‘ ELSE ‘ NOPRINT ‘;

-SET &field2np = IF … THEN ‘ ‘ ELSE ‘-*’;

SUM

FIELDONE AS ‘some nice label’ &field1np

&field2np.EVAL FLDTWO AS ‘some other label’

slide37

5. EXTRACT

● conditional display:

-SET &field1np = IF … THEN ‘ ‘ ELSE ‘ NOPRINT ‘;

-SET &field2np = IF … THEN ‘ ‘ ELSE ‘-*’;

SUM

FIELDONE AS ‘some nice label’ &field1np

&field2np.EVAL FLDTWO AS ‘some other label’

● in-line documentation

-SET &field1np = IF … THEN ‘ ‘ ELSE ‘ NOPRINT ‘;

-SET &field2np = IF … THEN ‘ ‘ ELSE ‘-*’;

-* lower case and right

SUM

FIELDONE AS ‘some nice label’ &field2np

&field2np.EVAL FLDTWO AS ‘some other label’-* . . . . . . . . . . . . . . . . . . added for Lucy 9/07

AND COMPUTE RATE/D3%=FIELDONE/FLDTWO;

slide38

5. EXTRACT

● drilldowns:

The payoff for short names and boolean switches

character length of a url in IE is limited to

focexec=&DD0(SEA = ‘&SEA’ DIV=‘&DIV’ CUST=‘&CUST’ \

STY = ‘&STY’ SHWPIC= &SHWPIC ) , $

TYPE=CUSTOMERNAME,

DRILLMENUITEM=‘click for picture’,

focexec=&DD0(SEA = ‘&SEA’ DIV=‘&DIV’ CUST= CUSTID \

STY = ‘&STY’ SHWPIC= &SHWPICX ) ,

DRILLMENUITEM=‘click for detail’,

focexec=&DD1(SEA = ‘&SEA’ DIV=‘&DIV’ CUST= CUSTID \ STY = ‘&STY’ SHWPIC= &SHWPIC ) ,

$

~2k

slide39

5. EXTRACT

● drilldowns:

The payoff for short names and booleans.

character length is limited to ~ 2k

focexec=&DD0(SEA = ‘&SEA’ DIV=‘&DIV’ CUST=‘&CUST’ \

STY = ‘&STY’ SHWPIC= &SHWPIC ) , $

TYPE=CUSTOMERNAME,

DRILLMENUITEM=‘click for picture’,

focexec=&DD0(SEA = ‘&SEA’ DIV=‘&DIV’ CUST= CUSTID \

STY = ‘&STY’ SHWPIC= &SHWPICX ) ,

DRILLMENUITEM=‘click for detail’,

focexec=&DD1(SEA = ‘&SEA’ DIV=‘&DIV’ CUST= CUSTID \ STY = ‘&STY’ SHWPIC= &SHWPIC ) ,

$

● Elegant code is beautiful, fun to write, but self-indulgent.Clarity and self-documenting code beats elegance.

slide40

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • 5. data extract(s)
  • presentation layer
  • 7. maintainable code
slide41

6. Presentation Layer

  • Importance of Presentation
    • A well presented layout will have
      • The heading identifying the content
      • The user able to discern the facts from the report
      • Enough information about the report
        • program, date and time, user, pages etc.
      • Readability without aides
      • Due consideration to colour usage
        • Using Company colour scheme to promote Corporate image
        • Garish colours do not encourage end users to utilise reports
        • Too many colours can detract from content
        • Differing output formats do not support certain colours
        • Use colour codes instead of names
        • Printed / Viewed only report requirements
        • Excessive colours can be expensive on toner!!
slide42

Report Heading

Report Subheading 1

Report Subheading 2

Report Subheading 3

Report Dates

Report Parameter 1

Report Parameter 2

Report Parameter 3

Report Parameter 4

Report Parameter 5

Report Parameter 6

Report Parameter 7

Report Parameter 8

  • Report Sections
    • Heading
      • Corporate Image?
      • Report title(s)
        • Domain (Department?)
        • Reporting Group
        • Report description
        • Report level – Summary, Detail
      • Parameters
        • Date range selections
        • Verbose text not codes
slide43

Report Sections

    • Footing
      • Date and time of creation
        • Know to which time frame the report relates
      • User identity
        • Who created the report
          • Batch
          • Individual via portal
      • Page numbering
        • What page is this?
        • How many pages?
      • Data sensitivity
        • Commercial in Confidence
      • Program information?
        • Consider support requirements as well
slide44

Report Sections

    • Report Body
      • Well laid out
        • Can the User discern the facts?
        • Is the report easily readable
          • Report audience with disabilities
      • Consider disparate output pitfalls
        • Image locations differ between HTML and PDF
          • URL resource or embedded
        • Is the report paneled in PDF?
          • Have different report layouts with Sub Heads on sort fields
          • SQUEEZE or WRAP wide columns
          • Output via Report Caster (Report Broker)
        • Single Excel output
          • SET PAGE-NUM = OFF
        • Multiple worksheet bursting
          • ON TABLE PCHOLD FORMAT EXL2K BYTOC
      • Data density - Verbose or sparse
        • BYDISPLAY
slide45

RED

GREEN

RED

GREEN

  • Report Styling
    • Content - colouring, imaging and report usage
      • Corporate colour scheme
      • Avoid garish colours
        • Red and Green together – Ugh!
      • Images and / or Corporate logo
        • Avoid domination of report heading
      • Data type styling
        • Negative values
          • Braced
          • Coloured red
      • Fonts and Sizing
        • Three (generally available) main faces – arial, verdana, trebuchet
        • Disparate output formats
        • Special report usage
          • OCR
      • Printing a report
        • Will the report print equally as well in colour as mono?
slide46

Report Styling

    • Specific tips on using colours
      • Use codes instead of names
        • Use Web page advice
          • Using “websafe” colour ranges
          • #00, #33, #66, #99, #CC, #FF
        • Some colour printers are not able to discriminate
          • Closely related colours print the same
      • Do not use too many colours
        • Can make a report unbearable to view
        • Some people have Colour blindness
    • Fonts and Sizing
      • Are internal reports to be styled differently to external?
        • Separate styling code modules (CSS, WebFOCUS Style etc.)
      • Report special usage
        • Disabled person(s) as target audience
        • Particular layout requirement (e.g. OCR)

Colorsontheweb.com

slide47

Fex construction

  • 0. dictionary
  • 1.environment variables
  • 2. resource allocation
  • 3. JOINs
  • 4. DEFINEs
  • data extract(s)
  • presentation layer
  • maintainable code
slide48

7. Maintainable Code

  • Design of components
    • Flexibility of report static components
      • Header, Footer, Imagery
      • Image physical locations for differing output formats
        • PDF and HTML require different locations
        • Will the report be used via Report Caster
          • Well formed or complete URLs (excl. PDF)
      • Parameterise
      • Well formed and laid out
        • Program synopsis in header
        • Indentation
        • Code blocks
        • Aligned
        • Commented (Documented)
        • Consistent
slide49

Report Heading

Report Subheading 1

Report Subheading 2

Report Subheading 3

Report Dates

Report Parameter 1

Report Parameter 2

Report Parameter 3

Report Parameter 4

Report Parameter 5

Report Parameter 6

Report Parameter 7

Report Parameter 8

An example– A typical report layout

slide50

An example – Coding the “flexible” heading and footing

HEADING

" <+0 &Rep_Heading"

" <+0 &Rep_Heading1"

" <+0 &Rep_Heading2"

" <+0 &Rep_Heading3"

"&Rep_Dates <+0 "

-* Only show those parameter lines that contain data.

-IF &Rep_Parms1.LENGTH LE 1 AND &Rep_Parms2.LENGTH LE 1 THEN :SkipPrm1;

"&Rep_Parms1 <+0>&Rep_Parms2"

-:SkipPrm1;

-IF &Rep_Parms3.LENGTH LE 1 AND &Rep_Parms4.LENGTH LE 1 THEN :SkipPrm2;

"&Rep_Parms3 <+0>&Rep_Parms4"

-:SkipPrm2;

-IF &Rep_Parms5.LENGTH LE 1 AND &Rep_Parms6.LENGTH LE 1 THEN :SkipPrm3;

"&Rep_Parms5 <+0>&Rep_Parms6"

-:SkipPrm3;

-IF &Rep_Parms7.LENGTH LE 1 AND &Rep_Parms8.LENGTH LE 1 THEN :SkipPrm4;

"&Rep_Parms7 <+0>&Rep_Parms8"

-:SkipPrm4;

FOOTING BOTTOM

"Produced by: &Userid <+0>Page:<TABPAGENO of <TABLASTPAGE<+0>Created on: &RepDate at &RepTime"

slide51

An example – Default variables used in heading and footing

-* Default report variables to ensure focexec doesn't prompt or fail

-DEFAULT &WFFMT = 'HTML'

-DEFAULT &Rep_Heading = 'Possible WebFOCUS Standard'

-DEFAULT &Rep_Heading1 = ''

-DEFAULT &Rep_Heading2 = ''

-DEFAULT &Rep_Heading3 = 'Reporting Criteria:'

-DEFAULT &Rep_Dates = ''

-DEFAULT &Rep_Parms1 = '' , &Rep_Parms2 = '' , &Rep_Parms3 = '' , &Rep_Parms4 = ''

-DEFAULT &Rep_Parms5 = '' , &Rep_Parms6 = '' , &Rep_Parms7 = '' , &Rep_Parms8 = ''

-SET &Userid = GETUSER(USERID);

-SET &RepDate = &DATEtDMYY;

-SET &RepTime = EDIT(&TOD,'99$:99$:99');

slide52

An example – WebFOCUS style sheet - cover main output formats

TYPE=HEADING, LINE=1, ITEM=1, CLASS=Headline1a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=14,$

TYPE=HEADING, LINE=1, ITEM=2, CLASS=Headline1b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=14,$

TYPE=HEADING, LINE=2, ITEM=1, CLASS=HeadLine2a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=12,$

TYPE=HEADING, LINE=2, ITEM=2, CLASS=HeadLine2b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=12,$

TYPE=HEADING, LINE=3, ITEM=1, CLASS=HeadLine3a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=3, ITEM=2, CLASS=HeadLine3b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=4, ITEM=1, CLASS=HeadLine4, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=4, ITEM=2, CLASS=HeadLine4, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=5, ITEM=1, CLASS=HeadLine5, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=5, ITEM=2, CLASS=HeadLine5, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=6, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=6, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=7, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=7, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=8, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=8, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=9, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=9, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=1, CLASS=FootPart1, WIDTH=2.62, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=2, CLASS=FootPart2, WIDTH=0.90, JUSTIFY=RIGHT, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=3, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=4, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=5, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=6, CLASS=FootPart4, WIDTH=3.37, JUSTIFY=RIGHT, STYLE=BOLD, SIZE=8,$

slide53

An example – Using external Cascading Style Sheets – HTML control

.HeadLine1a {font-family:Tahoma; font-size:14pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:29%; text-align:left; border-style: NONE;}

.HeadLine1b {font-family:Tahoma; font-size:14pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:69%; text-align:left; border-style: NONE;}

.HeadLine2a {font-family:Tahoma; font-size:12pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:29%; text-align:left; border-style: NONE;}

.HeadLine2b {font-family:Tahoma; font-size:12pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:69%; text-align:left; border-style: NONE;}

.HeadLine3a {font-family:Tahoma; font-size:10pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:29%; text-align:left; border-style: NONE;}

.HeadLine3b {font-family:Tahoma; font-size:10pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:69%; text-align:left; border-style: NONE;}

.HeadLine4 {font-family:Tahoma; font-size:10pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:49%; text-align:left; border-style: NONE;}

.HeadLine5 {font-family:Tahoma; font-size:8pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:49%; text-align:left; border-style: NONE;}

.HeadLine6 {font-family:Tahoma; font-size:8pt; font-weight:bold; color:#000000;

background-color:#FFFFFF; width:49%; text-align:left; vertical-align:middle;

border-style: NONE;}

.FootPart1 {font-family:Tahoma; font-size:8pt; font-weight:normal; color:#000000;

background-color:#FFFFFF; width:35%; text-align:left; border-style: NONE;}

.FootPart2 {font-family:Tahoma; font-size:8pt; font-weight:normal; color:#000000;

background-color:#FFFFFF; width:12%; text-align:right; border-style: NONE;}

.FootPart3 {font-family:Tahoma; font-size:8pt; font-weight:normal; color:#000000;

background-color:#FFFFFF; width:2%; text-align:center; border-style: NONE;}

.FootPart4 {font-family:Tahoma; font-size:8pt; font-weight:normal; color:#000000;

background-color:#FFFFFF; width:45%; text-align:right; border-style: NONE;}

slide54

7. Reusable Code

  • Reusability of components
    • Coding modules
      • Parameterise
      • Reduction of maintenance
        • One change fixes all
      • Decreases development time
        • Ease of Usage by Power Users in End User reporting
        • Consistency across BI
      • Easier learning curve
        • of learning complexities of style sheets
slide55

Reducing code development and maintenance timings

-INCLUDE std_init

DEFINE FILE CAR

IMG/A36 WITH COUNTRY MISSING ON = IF '&WFFMT' EQ 'EXL2K'

THEN '<img src=&ImageFile border=0>' ELSE MISSING;

END

TABLE FILE CAR

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY AS 'Country'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR AS 'Car'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR

BY MODEL AS 'Model'

-INCLUDE std_head

-INCLUDE std_foot

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

-INCLUDE std_style

ENDSTYLE

END

-RUN

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-* Focexec: std_init.fex

-*

-* Author: Anthony Alsford - EDATA Limited

-*

-* Date: 29 August 2006

-*

-* Project: IBI User Conference 2007

-* WebFOCUS Reporting Standards

-*

-* Purpose: Provide initialisation procedure for standard

-* reporting within WebFOCUS.

-*

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-DEFAULT &WFFMT = 'HTML'

-SET &ImageFile = IF '&WFFMT.EVAL' EQ 'PDF' THEN 'web.gif' ELSE '/ibi_html/web.gif';

-SET &ImagePos = IF '&WFFMT.EVAL' EQ 'PDF' THEN ' POSITION=(5.50 0.00), ' ELSE '';

-DEFAULT &Rep_Heading = 'Focus on Developers'

-DEFAULT &Rep_Heading1 = 'Thought provoking Style'

-DEFAULT &Rep_Heading2 = ''

-DEFAULT &Rep_Dates = ''

-DEFAULT &Rep_Parms1 = '' , &Rep_Parms2 = '' , &Rep_Parms3 = '' , &Rep_Parms4 = ''

-DEFAULT &Rep_Parms5 = '' , &Rep_Parms6 = '' , &Rep_Parms7 = '' , &Rep_Parms8 = ''

-SET &Userid = GETUSER(USERID);

-SET &RepDate = &DATEtDMYY;

-SET &RepTime = EDIT(&TOD,'99$:99$:99');

-RUN

SET CSSURL = '/approot/standards/standard.css'

SET HTMLCSS = ON

SET NODATA = ''

slide56

Reducing code development and maintenance timings

-INCLUDE std_init

DEFINE FILE CAR

IMG/A36 WITH COUNTRY MISSING ON = IF '&WFFMT' EQ 'EXL2K'

THEN '<img src=&ImageFile border=0>' ELSE MISSING;

END

TABLE FILE CAR

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY AS 'Country'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR AS 'Car'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR

BY MODEL AS 'Model'

-INCLUDE std_head

-INCLUDE std_foot

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

-INCLUDE std_style

ENDSTYLE

END

-RUN

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-* Focexec: std_head.fex

-*

-* Author: Anthony Alsford - EDATA Limited

-*

-* Date: 29 August 2006

-*

-* Project: IBI User Conference 2007

-* WebFOCUS Reporting Standards

-*

-* Purpose: Provide standard heading using variable

-* reporting within WebFOCUS.

-*

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

HEADING

" <+0 &Rep_Heading"

" <+0 &Rep_Heading1"

" <+0 &Rep_Heading2"

" <+0 &Rep_Heading3"

"&Rep_Dates <+0 "

-* Only show those parameter lines that contain data.

-IF &Rep_Parms1.LENGTH LE 1 AND &Rep_Parms2.LENGTH LE 1 THEN :SkipPrm1;

"&Rep_Parms1 <+0>&Rep_Parms2"

-:SkipPrm1;

-IF &Rep_Parms3.LENGTH LE 1 AND &Rep_Parms4.LENGTH LE 1 THEN :SkipPrm2;

"&Rep_Parms3 <+0>&Rep_Parms4"

-:SkipPrm2;

-IF &Rep_Parms5.LENGTH LE 1 AND &Rep_Parms6.LENGTH LE 1 THEN :SkipPrm3;

"&Rep_Parms5 <+0>&Rep_Parms6"

-:SkipPrm3;

-IF &Rep_Parms7.LENGTH LE 1 AND &Rep_Parms8.LENGTH LE 1 THEN :SkipPrm4;

"&Rep_Parms7 <+0>&Rep_Parms8"

-:SkipPrm4;

slide57

Reducing code development and maintenance timings

-INCLUDE std_init

DEFINE FILE CAR

IMG/A36 WITH COUNTRY MISSING ON = IF '&WFFMT' EQ 'EXL2K'

THEN '<img src=&ImageFile border=0>' ELSE MISSING;

END

TABLE FILE CAR

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY AS 'Country'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR AS 'Car'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR

BY MODEL AS 'Model'

-INCLUDE std_head

-INCLUDE std_foot

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

-INCLUDE std_style

ENDSTYLE

END

-RUN

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-* Focexec: std_foot.fex

-*

-* Author: Anthony Alsford - EDATA Limited

-*

-* Date: 29 August 2006

-*

-* Project: IBI User Conference 2007

-* WebFOCUS Reporting Standards

-*

-* Purpose: Provide standard footing using variable

-* reporting within WebFOCUS.

-*

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FOOTING BOTTOM

"Produced by: &Userid <+0>Page:<TABPAGENO of <TABLASTPAGE<+0>Created on: &RepDate at &RepTime"

slide58

Reducing code development and maintenance timings

-INCLUDE std_init

DEFINE FILE CAR

IMG/A36 WITH COUNTRY MISSING ON = IF '&WFFMT' EQ 'EXL2K'

THEN '<img src=&ImageFile border=0>' ELSE MISSING;

END

TABLE FILE CAR

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY AS 'Country'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR AS 'Car'

SUM RCOST AS 'Retail Cost'

DCOST AS 'Dealer Cost'

BY COUNTRY

BY CAR

BY MODEL AS 'Model'

-INCLUDE std_head

-INCLUDE std_foot

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

-INCLUDE std_style

ENDSTYLE

END

-RUN

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-* Focexec: std_style.fex

-*

-* Author: Anthony Alsford - EDATA Limited

-*

-* Date: 29 August 2006

-*

-* Project: IBI User Conference 2007

-* WebFOCUS Reporting Standards

-*

-* Purpose: Provide standard styling using variable

-* reporting within WebFOCUS.

-*

-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

UNITS=IN, PAGESIZE='A4', LEFTMARGIN=0.20, RIGHTMARGIN=0.20, TOPMARGIN=0.20,

BOTTOMMARGIN=0.20, SQUEEZE=ON, ORIENTATION=PORTRAIT, BACKCOLOR=RGB(240 245 255),$

TYPE=HEADING, IMAGE=&ImageFile, CLASS=HeadImg, SIZE=(2.25 0.45), &ImagePos$

TYPE=HEADING, BORDER=LIGHT, BORDER-STYLE=SOLID, SIZE=8, BACKCOLOR='WHITE', STYLE=BOLD,$

TYPE=HEADING, LINE=1, ITEM=1, CLASS=Headline1a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=14,$

TYPE=HEADING, LINE=1, ITEM=2, CLASS=Headline1b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=14,$

TYPE=HEADING, LINE=2, ITEM=1, CLASS=HeadLine2a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=12,$

TYPE=HEADING, LINE=2, ITEM=2, CLASS=HeadLine2b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=12,$

TYPE=HEADING, LINE=3, ITEM=1, CLASS=HeadLine3a, WIDTH=1.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=3, ITEM=2, CLASS=HeadLine3b, WIDTH=5.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=4, ITEM=1, CLASS=HeadLine4, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=4, ITEM=2, CLASS=HeadLine4, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=10,$

TYPE=HEADING, LINE=5, ITEM=1, CLASS=HeadLine5, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=5, ITEM=2, CLASS=HeadLine5, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=6, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=6, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=7, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=7, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=8, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=8, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=9, ITEM=1, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=HEADING, LINE=9, ITEM=2, CLASS=HeadLine6, WIDTH=3.75, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=1, CLASS=FootPart1, WIDTH=2.62, JUSTIFY=LEFT, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=2, CLASS=FootPart2, WIDTH=1.05, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=3, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=4, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=5, CLASS=FootPart3, WIDTH=0.15, JUSTIFY=CENTER, STYLE=BOLD, SIZE=8,$

TYPE=FOOTING, LINE=1, ITEM=6, CLASS=FootPart4, WIDTH=3.37, JUSTIFY=RIGHT, STYLE=BOLD, SIZE=8,$

slide60

1. SO THAT YOU CAN READ YOUR OWN CODE!

1. @@@@@@@@@@@@@@@@@@@@@@@

2. Big emergency?

Flip a switch, avoid a meltdown

3. Quick fix?

Might actually work

4. Major overhaul?

Instantly envision the whole thing

5. User confidence soars when your site is consistent.

TOP 10 REASONS FOR STANDARDS IN CODING

slide61

Report Caster good idea

killcast.fex

-SET &&KILLRPC = ‘N’ ;

slide62

Report Caster good idea

Make a backup copy of your empty Caster log file, on the day you first install

To purge your caster log,stop caster, and overwrite your botlog files from your backup; Faster than ‘Purge’

slide63

Report Caster good idea

Get the .gifs out of the .war file

Faster loading, if you have to get in on a dial- up line

slide64

MRE good idea - names

Don’t do this!Don’t name your domain, your report group, your folder, or your fex with its long, display name

slide65

MRE good idea - names

Do name your domain with a nice directory name, . . .

slide66

MRE good idea - names

… then give the nice long display name in the Properties Box

slide67

MRE good idea - names

Display name sorts in alpha order, True domain directory name is unchanged.

slide68

MRE good idea - names

Number your fexes in run order

Mre’s random fex names are for temp work, only

slide69

“Things should be made as simple as possible, but no simpler”

  • — Albert Einstein 1933

Questions