Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Basics of FOCUS Reporting Syntax

Similar presentations


Presentation on theme: "The Basics of FOCUS Reporting Syntax"— Presentation transcript:

1 The Basics of FOCUS Reporting Syntax
Report Debugging Techniques The Basics of FOCUS Reporting Syntax Nat Poe Information Builders

2 Report Debugging Techniques
Overview This session is designed for developers who have been creating reports in WebFOCUS and would like to learn the underlying language generated by WebFOCUS. We will review some FOCUS basics, build a report in Report Painter and then take it apart in the Text Editor. Emphasis on what happens when will be stressed.

3 FOCUS Basic Reporting - Overview
What is FOCUS? Reporting and database management tool from Information Builders Accesses a wide variety of files and databases (SQL, VSAM, etc.) Consistent, regardless of computer platform (TSO, UNIX, etc.) Utilizes simple words and phrases (4th generation language)

4 What is Needed to Create a Report?
FOCUS Basic Reporting - Overview What is Needed to Create a Report? Data Raw material for reports EDP MA UNI IA UMI MI EDP NJ SSI TX MC NY UMI MI SSI MO

5 What Else is Needed to Create a Report?
FOCUS Basic Reporting - Overview What Else is Needed to Create a Report? Data File Description FILENAME=TRAINING, SUFFIX=FOC SEGNAME=TRAINING, SEGTYPE=SH3 FIELDNAME=PIN, ALIAS=ID, FORMAT=A9, INDEX=I, $ FIELDNAME=COURSESTART, ALIAS=CSTART, FORMAT=YMD, $ FIELDNAME=COURSECODE, ALIAS=CCOD, FORMAT=A7, $ FIELDNAME=EXPENSES, ALIAS=COST, FORMAT=D8.2, $ FIELDNAME=GRADE, ALIAS=GRA, FORMAT=A2, $ FIELNAMED=LOCATION, ALIAS=LOC, FORMAT=A6, $ A template to describe the data

6 What Else is Needed to Create a Report?
FOCUS Basic Reporting - Overview What Else is Needed to Create a Report? Data File Description FOCUS Commands Report Request TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END

7 FOCUS Basic Reporting - Overview
FOCUS Commands Common words and phrases say what is in a report, not how to create it Each FOCEXEC is identified with a name, like MYRPT TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END Refers to field names found in the file description A file with FOCUS commands is called a FOCEXEC

8 FOCUS Basic Reporting - Overview
FOCUS Report Examples This is the MYRPT FOCEXEC PAGE 1 PIN EXPENSES COURSESTART , /18/1989 , /13/1991 2, /30/1990 , /13/1990 , /22/1989 , /19/1991 3, /14/1991 , /25/1990 , /29/1991 2, /22/1990 2, /14/1990 , /16/1990 , /02/1989 TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END

9 FOCUS Basic Reporting - Overview
A FOCUS Report - Detail PAGE 1 PIN EXPENSES COURSESTART , /18/1989 , /13/1991 2, /30/1990 , /13/1990 , /22/1989 , /19/1991 3, /14/1991 , /25/1990 , /29/1991 2, /22/1990 2, /14/1990 , /16/1990 , /02/1989 A detail report displays each individual data record Suppose you only need to display the total expenses for each employee

10 A FOCUS Report - Summary
FOCUS Basic Reporting - Overview A FOCUS Report - Summary PAGE 1 COURSESTART PIN EXPENSES COUNT , , , , , , , , , A summary report combines data records for totals Show how many records went into the total Suppose you need both detail and summary information in the same report

11 A FOCUS Report - Detail and Summary
FOCUS Basic Reporting - Overview A FOCUS Report - Detail and Summary PAGE 1 LOCATION PIN EXPENSES CA ,350.00 ,600.00 ,730.00 ,050.00 *TOTAL LOCATION CA 10,730.00 CO ,150.00 *TOTAL LOCATION CO 1,150.00 CT ,300.00 ,500.00 ,450.00 This is the detail This is the summary Suppose you want to create your own field

12 A FOCUS Report - Defined Fields
FOCUS Basic Reporting - Overview A FOCUS Report - Defined Fields This field was defined by the report writer PAGE 1 LOCATION PIN EXPENSES REBATE CA , , , , *TOTAL LOCATION CA 10, CO , *TOTAL LOCATION CO 1, CT , , , Suppose you have to send a report to management

13 A FOCUS Report - Custom Formatting
FOCUS Basic Reporting - Overview A FOCUS Report - Custom Formatting Format Changed PAGE 1 CORPORATE DIVISION COURSE EXPENSES COURSE DEPARTMENT NAME COST ACCOUNTING ANDERSON $ 3,100 WANG ,050 MARKETING DONATELLO ,700 VALINO ,300 TOTAL CORPORATE DIVISION COURSE COSTS ARE: 10,150 Heading Column Titles Subfoot

14 Data From Multiple Files in One Report
FOCUS Basic Reporting - Overview Data From Multiple Files in One Report Where did this data come from? PAGE 1 CORPORATE DIVISION COURSE EXPENSES COURSE DEPARTMENT NAME COST ACCOUNTING ANDERSON $ 3,100 WANG ,050 MARKETING DONATELLO ,700 VALINO ,300 TOTAL CORPORATE DIVISION COURSE COSTS ARE: 10,150 Data from EMPDATA File Data from TRAINING File

15 FOCUS Basic Reporting – Detail Reports
FOCUS Report Request Basic rules to write a report

16 FOCUS Report Request Components
FOCUS Basic Reporting – Detail Reports FOCUS Report Request Components TABLE FILE EMPDATA Display a list of employees and their annual salary PRINT PIN LASTNAME SALARY Create a Report END Display Each Record Fields to Display No More Commands

17 FOCUS Basic Reporting – Detail Reports
Command Placement PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA Display a list of employees and their annual salary Need at least one space between each word END is always on its own line

18 FOCUS Basic Reporting – Detail Reports
The PRINT Verb PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA Display a list of employees and their annual salary Never use the PRINT verb more than once

19 FOCUS Basic Reporting – Detail Reports
Display employees and their annual salary PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA What determines the order of the fields? PAGE 1 PIN LASTNAME SALARY VALINO $55,500.00 BELLA $62,500.00 CASSANOVA $70,000.00 ADAMS $62,500.00 ADDAMS $54,100.00 PATEL $55,500.00 SANCHEZ $83,000.00 SO $43,400.00 PULASKI $33,000.00 ANDERSON $32,400.00

20 FOCUS Basic Reporting – Detail Reports
Field Order TABLE FILE EMPDATA PRINT LASTNAME PIN SALARY END Show the last name first, PIN second, and salary last Fields in the report are in the order requested PAGE 1 LASTNAME PIN SALARY VALINO $55,500.00 BELLA $62,500.00 CASSANOVA $70,000.00 ADAMS $62,500.00 ADDAMS $54,100.00 PATEL $55,500.00 SANCHEZ $83,000.00 SO $43,400.00 PULASKI $33,000.00 ANDERSON $32,400.00

21 FOCUS Report Request: Review
FOCUS Basic Reporting – Detail Reports FOCUS Report Request: Review To create a report, you start with: TABLE FILE filename To display fields from a file in a report, use: PRINT fieldname fieldname … To tell FOCUS there are no more commands, use: END 2a

22 FOCUS Basic Reporting – Detail Reports
Order of Data Controlling the sequence of information

23 Order of Data: Introduction
FOCUS Basic Reporting – Detail Reports Order of Data: Introduction TABLE FILE EMPDATA PRINT LASTNAME SALARY END Show employee names and their salaries PAGE 1 LASTNAME SALARY VALINO $55,500.00 BELLA $62,500.00 CASSANOVA $70,000.00 ADAMS $62,500.00 ADDAMS $54,100.00 PATEL $55,500.00 SANCHEZ $83,000.00 SO $43,400.00 PULASKI $33,000.00 ANDERSON $32,400.00 What is the order of the data?

24 FOCUS Basic Reporting – Detail Reports
Sort Field TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME END Show salaries in order by last name PAGE 1 LASTNAME LASTNAME SALARY ADAMS ADAMS $62,500.00 ADDAMS ADDAMS $54,100.00 ANDERSON ANDERSON $32,400.00 BELLA BELLA $62,500.00 CASSANOVA CASSANOVA $70,000.00 CASTALANETTA CASTALANETTA $42,900.00 CHISOLM CHISOLM $43,000.00 CONRAD CONRAD $25,000.00 CONTI CONTI $32,300.00 Sort Field Sort field in the report

25 How a Report is Created - 1: Build a Table
FOCUS Basic Reporting – Detail Reports How a Report is Created - 1: Build a Table TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME WHERE RECORDLIMIT EQ 3 END VALINO DANIEL A CORP BELLA MICHAEL D SE ... CASSANOVA LOIS E WE Table to hold the data First three records in EMPDATA Note! Table built in order of BY field Data to be moved to the final report

26 How a Report is Created - 2: Build a Report
FOCUS Basic Reporting – Detail Reports How a Report is Created - 2: Build a Report TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME WHERE RECORDLIMIT EQ 3 END Is this field needed for the report? A) Yes B) No PAGE 1 LASTNAME LASTNAME SALARY BELLA BELLA $62,500.00 CASSANOVA CASSANOVA $70,000.00 VALINO VALINO $55,500.00

27 Location of BY Statement
FOCUS Basic Reporting – Detail Reports Location of BY Statement TABLE FILE EMPDATA PRINT SALARY BY LASTNAME END Show salaries in order by last name LASTNAME removed as a PRINT field PAGE 1 LASTNAME SALARY ADAMS $62,500.00 ADDAMS $54,100.00 ANDERSON $32,400.00 BELLA $62,500.00 CASSANOVA $70,000.00 CASTALANETTA $42,900.00 CHISOLM $43,000.00 CONRAD $25,000.00 CONTI $32,300.00 Sort field is placed after the PRINT fields Sort field is listed first

28 Sorting on More Than One Field
FOCUS Basic Reporting – Detail Reports Sorting on More Than One Field Print salaries in order by division and last name TABLE FILE EMPDATA PRINT SALARY BY DIV BY LASTNAME END DIV is the primary sort field LASTNAME is the secondary sort field BY is needed for every sort field

29 Displaying Duplicate BY Field Values
FOCUS Basic Reporting – Detail Reports Displaying Duplicate BY Field Values Print salaries in order by division and last name TABLE FILE EMPDATA PRINT SALARY BY DIV BY LASTNAME END PAGE 1 DIV LASTNAME SALARY CE ADAMS $62,500.00 ADDAMS $54,100.00 CHISOLM $43,000.00 CONRAD $25,000.00 GORDON $25,400.00 GRAFF $45,000.00 KASHMAN $33,300.00 LASTRA $115,000.00 PUMA $40,900.00 ROSENTHAL $49,500.00 CORP ANDERSON $32,400.00 CVEK $62,500.00 Only the first of duplicate sort field values is listed What happens if two people have the same last name in a division? A) Duplicate name appears B) Duplicate name is blank

30 Sorting Numeric Fields
FOCUS Basic Reporting – Detail Reports Sorting Numeric Fields Show employees in order by salary TABLE FILE EMPDATA PRINT LASTNAME BY SALARY END PAGE 1 SALARY LASTNAME $19, RUSSO $25, CONRAD $25, GORDON $26, LOPEZ $30, OLSON $30, MORAN $32, CONTI $32, ANDERSON $33, PULASKI $33, KASHMAN $35, DONATELLO $35, ELLNER Always need at least one verb object Where is the smallest salary listed?

31 FOCUS Basic Reporting – Detail Reports
Sorting High to Low List the highest salary first TABLE FILE EMPDATA PRINT LASTNAME BY HIGHEST SALARY END PAGE 1 SALARY LASTNAME $115, LASTRA $83, SANCHEZ $80, NOZAWA $79, SOPENA $70, CASSANOVA $62, BELLA ADAMS CVEK WHITE HIRSCHMAN WANG $58, GOTLIEB HIGHEST is between BY and SALARY Why are some salaries missing?

32 FOCUS Basic Reporting – Detail Reports
Order of Data: Review To control the order of data, use: BY fieldname BY HIGHEST fieldname BY is repeated for every sort field. The BY statements are placed after your PRINT fields. The BY fields appear first in the report. If there are duplicate sort field values, the duplicates are blank. 2a 2b

33 FOCUS Basic Reporting – Detail Reports
Invisible Sort Fields Sorting with a field that is not displayed in the report

34 Invisible Sort Fields: Introduction
FOCUS Basic Reporting – Detail Reports Invisible Sort Fields: Introduction TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY END Print all salaries after the name and sort by highest salary PAGE 1 SALARY LASTNAME SALARY $115, LASTRA $115,000.00 $83, SANCHEZ $83,000.00 $80, NOZAWA $80,500.00 $79, SOPENA $79,000.00 $70, CASSANOVA $70,000.00 $62, BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 $58, GOTLIEB $58,800.00 The PRINT field value appears for all employees What happens if we remove BY HIGHEST SALARY?

35 Not Printing a Sort Field
FOCUS Basic Reporting – Detail Reports Not Printing a Sort Field Sort by salary, but don’t show it, because we are printing it too TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT END PAGE 1 LASTNAME SALARY LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 GOTLIEB $58,800.00 Still sorting by SALARY, but it will not be displayed

36 FOCUS Basic Reporting – Detail Reports
How NOPRINT Works TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT WHERE RECORDLIMIT EQ 3 END VALINO ... BELLA CASSANOVA PAGE 1 LASTNAME SALARY CASSANOVA $70,000.00 BELLA $62,500.00 VALINO $55,500.00 Sort field is not moved to the report

37 Order of Duplicate Field Values
FOCUS Basic Reporting – Detail Reports Order of Duplicate Field Values Sort by salary, but don’t show it, because we are printing it too TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT END PAGE 1 LASTNAME SALARY LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 GOTLIEB $58,800.00 To see every field value in order, make it a verb object and use NOPRINT on the BY field What is the order of the names with the same salary?

38 Multiple Invisible Sort Fields
FOCUS Basic Reporting – Detail Reports Multiple Invisible Sort Fields TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT BY LASTNAME NOPRINT END Employees with the same salary must be in name order PAGE 1 LASTNAME SALARY LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 ADAMS $62,500.00 BELLA $62,500.00 CVEK $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 WHITE $62,500.00 GOTLIEB $58,800.00 Since last name is printed, we only need to sort it. What happens if two people have the same last name and make the same salary? A) Duplicate name appears B) Duplicate name is blank

39 Invisible Sort Fields: Review
FOCUS Basic Reporting – Detail Reports Invisible Sort Fields: Review To see every field value in order, use: TABLE FILE filename PRINT field ... BY field NOPRINT END To see every field value in high to low order, use: BY HIGHEST field NOPRINT Notes: NOPRINT with a sort field still controls the order of data in a report. Optional: Assign Exercises 2a, 2b, and 2c now. There are links for the exercises at the bottom of the screen. Next: Command Syntax Review 2a 2b 2c

40 FOCUS Basic Reporting – Detail Reports
Command Syntax Review Limit: 1024 fields (As of Rel 7.7) TABLE FILE filename PRINT fieldname BY [HIGHEST] fieldname [NOPRINT] END Optional Optional Limit: 32 Sort Fields

41 FOCUS Basic Reporting – Detail Reports
Summary To create a report, you start with: TABLE FILE filename To display fields from a file in a report, use: PRINT fieldname fieldname … To control the order of data, use: BY fieldname BY HIGHEST fieldname To sort on a field, but not show it in a report, use: BY fieldname NOPRINT BY HIGHEST fieldname NOPRINT To tell FOCUS there are no more commands, use: END Next: Simple Formatting

42 FOCUS Basic Reporting – Simple Formatting
Column Titles Controlling Column Titles

43 Column Titles: Introduction
FOCUS Basic Reporting – Simple Formatting Column Titles: Introduction TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME END Show the salary and hire date by name Field names are the column titles PAGE 1 LASTNAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07 CONRAD $25, /03/30 Notes: Starting with a basic report request. By default, the fieldname becomes the column title. This is FOCEXEC: M3Aa.FEX Next: Changing the Column Title

44 Customized Column Title
FOCUS Basic Reporting – Simple Formatting Customized Column Title TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME AS ‘LAST NAME’ END Show the LASTNAME field as: LAST NAME in the report Use single quotes (apostrophes) How would you show this field as: ANNUAL SALARY? PAGE 1 LAST NAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07 CONRAD $25, /03/30

45 Column Titles: Multiple Lines
FOCUS Basic Reporting – Simple Formatting Column Titles: Multiple Lines TABLE FILE EMPDATA PRINT SALARY AS ‘ANNUAL,SALARY’ HIREDATE BY LASTNAME AS ‘LAST NAME’ END Show SALARY column title as: ANNUAL SALARY on two lines Can have up to five lines Use a comma to start a new line Why is this column title left-justified? Why is this column title right-justified? PAGE 1 ANNUAL LAST NAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07 CONRAD $25, /03/30

46 FOCUS Basic Reporting – Simple Formatting
Column Titles: Review To change the column title, use: fieldname AS ‘text’ To create up to five lines of column titles, use: fieldname AS ‘text,text, …’ 3a

47 FOCUS Basic Reporting – Simple Formatting
Headings Messages at the top of each page

48 FOCUS Basic Reporting – Simple Formatting
One Line Heading TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” PRINT SALARY HIREDATE BY LASTNAME END Create an employee information message at the top of each page Place HEADING on its own line The text line is set off by double quotes (“…”) PAGE 1 EMPLOYEE INFORMATION LASTNAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07 Message will be at the top of each page

49 Multiple Line Headings
FOCUS Basic Reporting – Simple Formatting Multiple Line Headings TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS” PRINT SALARY HIREDATE BY LASTNAME END Add a second line of text to the heading stating it is for all divisions For additional heading lines, place each new line of text within double quotes PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07

50 Skipping Lines in a Heading
FOCUS Basic Reporting – Simple Formatting Skipping Lines in a Heading TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS </1” PRINT SALARY HIREDATE BY LASTNAME END Place a blank line between the heading and column title </n - Skip n lines Can only be used inside “…” text lines PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07

51 Centering Lines in a Heading
FOCUS Basic Reporting – Simple Formatting Centering Lines in a Heading TABLE FILE EMPDATA HEADING CENTER “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS </1” PRINT SALARY HIREDATE BY LASTNAME END Put the heading in the center of each page Centered on the width of report PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE ADAMS $62, /05/01 ADDAMS $54, /03/15 ANDERSON $32, /05/14 BELLA $62, /07/18 CASSANOVA $70, /04/11 CASTALANETTA $42, /01/09 CHISOLM $43, /02/07

52 FOCUS Basic Reporting – Simple Formatting
Headings: Review To create a message at the top of each page, use: HEADING “text” To create a centered heading message, use: HEADING CENTER To skip lines within heading text, use: “</n text </n” n is the number of lines to skip before or after the text. 3a 3b

53 FOCUS Basic Reporting – Simple Formatting
Footings A message at the end of each page Notes: We will see how to put a message at the end of each page. Next: FOOTING Statement

54 FOCUS Basic Reporting – Simple Formatting
Simple Footing TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME FOOTING “CONFIDENTIAL” END Create a confidential message at the end of each page ... WANG $49, /04/02 $62, /05/08 WHITE $62, /05/10 $40, /04/19 CONFIDENTIAL Automatically skips one line

55 Footing at the Bottom of the Page
FOCUS Basic Reporting – Simple Formatting Footing at the Bottom of the Page TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME FOOTING BOTTOM “CONFIDENTIAL” END Create a confidential message at the bottom of each page ... WANG $49, /04/02 $62, /05/08 WHITE $62, /05/10 $40, /04/19 CONFIDENTIAL

56 FOCUS Basic Reporting – Simple Formatting
Centering a Footing TABLE FILE EMPDATA PRINT SALARY TITLE BY LASTNAME FOOTING BOTTOM CENTER “CONFIDENTIAL” END Put the footing in the center of the page Place before or after BOTTOM ... WANG $49, /04/02 $62, /05/08 WHITE $62, /05/10 $40, /04/19 CONFIDENTIAL

57 FOCUS Basic Reporting – Simple Formatting
Footings: Review To create a message at the end of each page, use: FOOTING “text” To create a footing message at the page bottom, use: FOOTING BOTTOM To create a centered footing message, use: FOOTING CENTER BOTTOM can be placed before or after CENTER 3a 3b 3c

58 FOCUS Basic Reporting – Simple Formatting
Separating Sections Controlling the spacing of sort fields

59 Separating Sections: Introduction
FOCUS Basic Reporting – Simple Formatting Separating Sections: Introduction TABLE FILE EMPDATA PRINT HIREDATE BY DIV BY DEPT BY LASTNAME END Show employee hire dates grouped by division and department PAGE 1 DIV DEPT LASTNAME HIREDATE CE ADMIN SERVICES GORDON /12/05 MARKETING ADAMS /05/01 PERSONNEL CONRAD /03/30 GRAFF /07/11 KASHMAN /03/14 PROGRAMMING & DVLPMT PUMA /03/20 ROSENTHAL /05/01 SALES ADDAMS /03/15 CHISOLM /02/07 LASTRA /04/03 CORP ACCOUNTING ANDERSON /05/14 LOPEZ /11/07 SANCHEZ /03/05

60 FOCUS Basic Reporting – Simple Formatting
Skipping Lines TABLE FILE EMPDATA PRINT HIREDATE BY DIV BY DEPT SKIP-LINE BY LASTNAME END Place a blank line between each department Can only be used with sort fields PAGE 1 DIV DEPT LASTNAME HIREDATE CE ADMIN SERVICES GORDON /12/05 MARKETING ADAMS /05/01 PERSONNEL CONRAD /03/30 GRAFF /07/11 KASHMAN /03/14 PROGRAMMING & DVLPMT PUMA /03/20 ROSENTHAL /05/01 SALES ADDAMS /03/15

61 FOCUS Basic Reporting – Simple Formatting
Underlines TABLE FILE EMPDATA PRINT HIREDATE BY DIV UNDER-LINE BY DEPT SKIP-LINE BY LASTNAME END Place an underline between each division Note: Northeast Marketing has two other employees on the prior page PAGE 3 DIV DEPT LASTNAME HIREDATE NE MARKETING PATEL /03/01 SALES DUBOIS /01/07 MEDINA /10/10 SE CONSULTING ELLNER /05/13 WANG /04/02 CUSTOMER SUPPORT HIRSCHMAN /09/12 MARKETING BELLA /07/18

62 Page Breaks: Conditional
FOCUS Basic Reporting – Simple Formatting Page Breaks: Conditional TABLE FILE EMPDATA PRINT HIREDATE BY DIV UNDER-LINE BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END If all employees in a department can’t fit on the current page, move them to a new page Note! All Northeast Marketing employees now start on this page PAGE 3 DIV DEPT LASTNAME HIREDATE NE MARKETING CONTI /04/02 LIEBER /03/21 PATEL /03/01 SALES DUBOIS /01/07 MEDINA /10/10 SE CONSULTING ELLNER /05/13 WANG /04/02 How many divisions are on this page?

63 Page Breaks: Unconditional
FOCUS Basic Reporting – Simple Formatting Page Breaks: Unconditional TABLE FILE EMPDATA PRINT HIREDATE BY DIV PAGE-BREAK BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END Start each new division on its own page Note! What page does the SE division start on? PAGE 3 DIV DEPT LASTNAME HIREDATE NE CU MA SA PAGE 4 SE CONSULTING ELLNER /05/13 WANG /04/02 CUSTOMER SUPPORT HIRSCHMAN /09/12 MARKETING BELLA /07/18 LEWIS /03/13

64 Resetting the Page Number
FOCUS Basic Reporting – Simple Formatting Resetting the Page Number Used with a PAGE-BREAK TABLE FILE EMPDATA PRINT HIREDATE BY DIV PAGE-BREAK REPAGE BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END Have each new division start with Page 1 PAGE 1 DIV DEPT LASTNAME HIREDATE NE CU MA SA SE CONSULTING ELLNER /05/13 WANG /04/02 CUSTOMER SUPPORT HIRSCHMAN /09/12 MARKETING BELLA /07/18 LEWIS /03/13

65 Separating Sections: Review
FOCUS Basic Reporting – Simple Formatting Separating Sections: Review Can only be used with sort fields 3a 3b 3c 3d

66 FOCUS Basic Reporting – Simple Formatting
Command Syntax Review Message at the top of each page TABLE FILE filename HEADING [CENTER] “text…” PRINT field[/align] [AS ‘text’] BY [HIGHEST] field[/align] [NOPRINT or AS ‘text’] FOOTING [CENTER] [BOTTOM] END Use: </n to skip n lines /L - Left Justify Title /C - Center Title /R - Right Justify Title Use: , to start on a new line Message at the end of each page

67 FOCUS Basic Reporting – Simple Formatting
Summary To change the column title, use: fieldname AS ‘text’ To create a message at the top of each page, use: HEADING [CENTER] “text” To create a message at the end of each page, use: FOOTING [CENTER] [BOTTOM] To change the spacing between sort fields, use: SKIP-LINE UNDER-LINE NOSPLIT PAGE-BREAK [REPAGE]

68 WebFOCUS Processing Sequence
Open an existing application Create a comprehensive procedure Explore the WebFOCUS Code and Processing Sequence for a Procedure: Phase 1 – Analyze and Parse the Request Phase 2 – Build the Internal Table Phase 3 – Process the Internal Table Phase 4 – Produce the Report

69 A Management Request Management would like a report that displays the total compensation (current salary and benefits) and training expenses in 1991 for Century Corporation employees sorted by region and by department. The report should include: - A new BENEFITS field calculated as 22% of current salary (SALARY). - Employees with BENEFITS greater than or equal to $5,000. - Departments with total compensation greater than or equal to $40,000. The entire report should be sorted by the total current salaries in descending order.

70 A Management Request

71 The Procedure’s Required Components
Report Feature WebFOCUS Command Description Combine two tables JOIN Combine EMPDATA and TRAINING as a non-unique JOIN. Aggregate data SUM Aggregate PIN as 'No. of,Emps' Virtual column at data source level DEFINE Create the BENEFITS field (format- D9M) equal to SALARY times 22 percent. Virtual column at report level COMPUTE Create the COMP field (format - D9M) equal to SALARY plus BENEFITS. Sort entire report BY TOTAL Sort by aggregated SALARY (hidden) in descending order. Sort on real data source values BY Sort by DIV AS ‘Region’ and by DEPT.

72 The Procedure’s Required Components
Report Feature WebFOCUS Command Description Selection on real data source values WHERE Select training courses attended by employees during 1991. Selection on virtual column values (DEFINE) Select BENEFITS greater than or equal to 5000. Selection on accumulated report values WHERE TOTAL Select aggregated values of COMP greater than or equal to Accumulate report totals COLUMN-TOTAL Add up all column values Page heading and footing HEADING and FOOTING Create a page heading and a page footing Report styling STYLE Use the PROBLUE StyleSheet

73 The WebFOCUS Processing Sequence
Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

74 The WebFOCUS Processing Sequence
Phase 1 Analyze and Parse the Request The process begins when you run a procedure. Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

75 FOCUS Command Processor
Phase One: Analyze and Parse the Request The FOCUS Command Processor reads each line of the procedure. Phase 1 Analyze and Parse the Request FOCUS Command Processor

76 Analyze and Parse the Request
Phase One: Analyze and Parse the Request Phase 1 Analyze and Parse the Request The syntax is validated according to the rules of the command invoked: JOIN DEFINE TABLE MATCH MAINTAIN MODIFY

77 Analyze and Parse the Request
Phase One: Analyze and Parse the Request If a syntax error is detected, WebFOCUS sends an error message to the application and processing stops. Phase 1 Analyze and Parse the Request

78 Analyze and Parse the Request
Phase One: Analyze and Parse the Request WebFOCUS evaluates the instructions to create a report. Phase 1 Analyze and Parse the Request

79 Analyze and Parse the Request
Phase One: Analyze and Parse the Request WebFOCUS locates and reads the Data Source Description. Phase 1 Analyze and Parse the Request

80 Analyze and Parse the Request
Phase One: Analyze and Parse the Request WebFOCUS constructs several tables in memory to assist the process: Phase 1 Analyze and Parse the Request

81 Build the Internal Table
Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table

82 Build the Internal Table
Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS reads the original table and performs the following operations: Select on real data source values (IF and WHERE). Construct virtual fields (DEFINE). Select on virtual fields (IF and WHERE on DEFINE fields). Phase 2 Build the Internal Table

83 Build the Internal Table
Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request Sort (and aggregate) source data to build the Internal Table. Phase 2 Build the Internal Table

84 Build the Internal Table
Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS generates report statistics (&RECORDS and &LINES) and closes the data sources. Phase 2 Build the Internal Table

85 Process the Internal Table
Phase Three: Process the Internal Table Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table

86 Process the Internal Table
Phase Three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table: Construct virtual columns (COMPUTE) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

87 Process the Internal Table
Phase three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table (continued): Select on Internal Table records (WHERE TOTAL) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

88 Process the Internal Table
Phase three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table (continued): Re-sort the records in the Internal Table (BY TOTAL) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

89 Phase four: Process the Internal Table
Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

90 Phase four: Process the Internal Table
Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Generate totals and subtotals. Phase 4 Produce the Report

91 Phase four: Process the Internal Table
Analyze and Parse the Request Perform RECAP on subtotals. Format the report Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

92 Phase four: Process the Internal Table
Analyze and Parse the Request Apply styling and display output. Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

93 Review: The WebFOCUS Processing Sequence
Phase 1 Analyze and Parse the Request Evaluate source code Load command module (TABLE) Select on real fields Construct and select on DEFINEs Sort and aggregate data Construct and select on COMPUTEs Re-sort Internal Table records Generate totals and subtotals Format, style and display output Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

94 Report Debugging Techniques
Thanks for attending!


Download ppt "The Basics of FOCUS Reporting Syntax"

Similar presentations


Ads by Google