FOCUS and WebFOCUS Output Formats: The More You Know Walter F. Blood Technical Director, FOCUS Division November, 2009 Copyright 2009, Information Builders. Slide 1 FOCUS and WebFOCUS Output Formats Agenda HTML Output Scrolling HTML Report Output SHOWBLANKS (HTML and EXL2K) TITLETEXT Attribute (HTML and EXL2K) EXL2K Output Locking EXCEL Spreadsheet Values Identifying Null Values in Excel 2000 EXCEL Table of Contents and EXCEL Named Ranges EXL2K LANDSCAPE and BORDER Options PDF Output Compressing PDF Output Files Respect Carriage Returns and / or Line Feeds Displaying the Total Number of Pages in a Sort Group: BYLASTPAGE Displaying Images stored in BLOB fields HTML Output Copyright 2009, Information Builders. Slide 3 FOCUS and WebFOCUS Output Formats Scrolling HTML Report Output TYPE=REPORT, HFREEZE={ON|TOP|BOTTOM|OFF}, [SCROLLHEIGHT={4|nn[.n]}], $ HFREEZE=ON Freezes the HEADING, COLUMN TITLEs, GRAND TOTALs and FOOTING HFREEZE=TOP Freezes the HEADING and COLUMN TITLEs HFREEZE=BOTTOM Freezes the GRAND TOTALs and FOOTING nn[.n] Is the height, in inches, of the scrollable area. The default is 4 inches. Copyright 2009, Information Builders. Slide 4 FOCUS and WebFOCUS Output Formats Scrolling HTML Report Output TABLE FILE CAR HEADING "Car Report" PRINT CAR MODEL SEATS RCOST DCOST BY COUNTRY FOOTING "Run on &TOD" ON TABLE COLUMN-TOTAL ON TABLE SET HTMLCSS ON ON TABLE SET PAGE OFF ON TABLE SET STYLE * TYPE=HEADING, JUSTIFY=CENTER,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 5 FOCUS and WebFOCUS Output Formats Scrolling HTML Report Output TABLE FILE CAR HEADING "Car Report" PRINT CAR MODEL SEATS RCOST DCOST BY COUNTRY FOOTING "Run on &TOD" ON TABLE COLUMN-TOTAL ON TABLE SET HTMLCSS ON ON TABLE SET PAGE OFF ON TABLE SET STYLE * TYPE=REPORT,HFREEZE=ON, SCROLLHEIGHT=2.0,$ TYPE=HEADING,JUSTIFY=CENTER,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 6 FOCUS and WebFOCUS Output Formats Scrolling HTML Report Output HFREEZE=TOP HFREEZE=BOTTOM Copyright 2009, Information Builders. Slide 7 FOCUS and WebFOCUS Output Formats SET SHOWBLANKS (HTML and EXL2K) SET SHOWBLANKS=ON ON TABLE SET SHOWBLANKS ON SET SHOWBLANKS=OFF DEFINE FILE MOVIES NEWCAT/A30 = IF CATEGORY EQ 'ACTION' THEN ' ACTION' ELSE IF CATEGORY EQ 'SCI/FI' THEN 'SCIENCE FICTION' ELSE IF CATEGORY EQ 'TRAIN/EX' THEN ' TRANING EXERCISE' ELSE IF CATEGORY EQ 'COMEDY' THEN 'COMEDY ' ELSE 'GENERAL'; END TABLE FILE MOVIES SUM CATEGORY LISTPR/D12.2 COPIES BY NEWCAT ON TABLE SET STYLE * GRID=OFF,$ TYPE=REPORT,FONT=COURIER NEW,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 8 FOCUS and WebFOCUS Output Formats SET SHOWBLANKS (HTML and EXL2K) Preserve leading and internal blanks in HTML and EXL2K output Trailing blanks will not be preserved except in HEADING, SUBHEAD, FOOTING, and SUBFOOT lines that use the default HEADING or FOOTING alignment SET SHOWBLANKS=ON DEFINE FILE MOVIES NEWCAT/A30 = IF CATEGORY EQ 'ACTION' THEN ' ACTION' ELSE IF CATEGORY EQ 'SCI/FI' THEN 'SCIENCE FICTION' ELSE IF CATEGORY EQ 'TRAIN/EX' THEN ' TRANING EXERCISE' ELSE IF CATEGORY EQ 'COMEDY' THEN 'COMEDY ' ELSE 'GENERAL'; END TABLE FILE MOVIES SUM CATEGORY LISTPR/D12.2 COPIES BY NEWCAT ON TABLE SET STYLE * GRID=OFF,$ TYPE=REPORT,FONT=COURIER NEW,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 9 FOCUS and WebFOCUS Output Formats TITLETEXT Attribute TABLE FILE CAR SUM RCOST DCOST BY COUNTRY BY CAR BY MODEL ON TABLE PCHOLD FORMAT HTML ON TABLE SET STYLE * TYPE=REPORT,FONT=COURIER NEW, TITLETEXT='Car Sales Report',$ ENDSTYLE END Using HTML allows the Browser Title to be customized Feature not applicable to PDF FOCUS and WebFOCUS Output Formats TITLETEXT Attribute TABLE FILE CAR SUM RCOST DCOST BY COUNTRY BY CAR BY MODEL ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT,FONT=COURIER NEW, TITLETEXT='Car Sales Report',$ ENDSTYLE END Excel limits the length of worksheet titles to 31 characters. The following special characters cannot be used: ':', '?', '*', and '/'. EXL2K Output Copyright 2009, Information Builders. Slide 12 FOCUS and WebFOCUS Output Formats Locking EXCEL Spreadsheet / Columns / Values TYPE=REPORT, PROTECTED={ON|OFF}, [LOCKED={ON|OFF}],$ PROTECTED=ON Required to lock a spreadsheet. If the LOCKED=OFF attribute is omitted, the entire spreadsheet is locked. PROTECTED=OFF Spreadsheet is not locked. Default behavior. LOCKED=ON Locks the entire spreadsheet with PROTECTED=ON LOCKED=OFF Unlocks the spreadsheet as a whole, but enables you to lock or unlock specific cells or groups of cells. TYPE=type,[COLUMN=columnspec],LOCKED={ON|OFF},$ Copyright 2009, Information Builders. Slide 13 FOCUS and WebFOCUS Output Formats Lock an Entire Excel Spreadsheet TABLE FILE CAR HEADING "Profit By Car " " " SUM RETAIL_COST DEALER_COST COMPUTE PROFIT/D12.2= RETAIL_COST - DEALER_COST; BY CAR ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT,COLOR=BLUE, BACKCOLOR=SILVER,SIZE=9,$ TYPE=REPORT,PROTECTED=ON,$ TYPE=HEADING,STYLE=BOLD, SIZE=14,$ TYPE=TITLE,STYLE=BOLD,SIZE=11,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 14 FOCUS and WebFOCUS Output Formats Lock a Single Column on an Excel Spreadsheet TABLE FILE CAR HEADING "Profit By Car </1" SUM RETAIL_COST DEALER_COST COMPUTE PROFIT/D12.2= RETAIL_COST - DEALER_COST; BY CAR ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT,COLOR=BLUE, BACKCOLOR=SILVER,SIZE=9,$ TYPE=REPORT, PROTECTED=ON,LOCKED=OFF,$ TYPE=HEADING,STYLE=BOLD, SIZE=14,$ TYPE=TITLE,STYLE=BOLD,SIZE=11,$ TYPE=DATA,COLUMN=2,LOCKED=ON,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 15 FOCUS and WebFOCUS Output Formats Identifying Null Values in Excel 2000 ON TABLE SET EMPTYCELLS [ON|OFF] ON Indicates that empty spaces are displayed in the cells of the report for each field where null values are retrieved from the database. ON is the default. OFF Indicates that zeros, or the character string specified with the SET NODATA command, will be displayed in the cells of the report for each field where null values are retrieved from the database. OFF must be specified when using SET NODATA. ON TABLE SET NODATA string String of characters displayed in the cells of the report for each field where null values are retrieved from the database. Maximum number of characters is 11 If the number of characters in the string exceeds the length of the output field, the additional characters will not be displayed. If special characters are used, the string must be enclosed in single quotes. Copyright 2009, Information Builders. Slide 16 FOCUS and WebFOCUS Output Formats Identifying Null Values in Excel 2000 TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE PCHOLD FORMAT EXL2K END TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET EMPTYCELLS OFF ON TABLE SET NODATA 'n/a' ON TABLE PCHOLD FORMAT EXL2K END ON TABLE SET EMPTYCELLS OFF -*ON TABLE SET NODATA 'n/a' Copyright 2009, Information Builders. Slide 17 FOCUS and WebFOCUS Output Formats EXCEL Table of Contents ON TABLE {HOLD|PCHOLD} FORMAT EXL2K BYTOC SET COMPOUND=BYTOC Only a single BY field is allowed in EXL2K Multiple BY fields are allowed in HTML Optional number following BYTOC keyword can only be 1 Report must contain at least one BY field. BY field can be NOPRINT’d Worksheet tab names are the BY field values that correspond to the data on the current worksheet TITLETEXT keyword in the stylesheet will be ignored. Copyright 2009, Information Builders. Slide 18 FOCUS and WebFOCUS Output Formats EXCEL Table of Contents SET COMPOUND=BYTOC TABLE FILE CAR PRINT SALES BY COUNTRY NOPRINT BY CAR ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT,STYLE=BOLD,COLOR=YELLOW,BACKCOLOR=BLACK,$ TYPE=DATA,BACKCOLOR=RED, $ TYPE=DATA,COLUMN=CAR,COLOR=BLUE,BACKCOLOR=YELLOW,$ END Copyright 2009, Information Builders. Slide 19 FOCUS and WebFOCUS Output Formats EXCEL Named Ranges TYPE=type, IN-RANGES=rangename, $ type Identifies the WebFOCUS report component to be included in the range. Normally, both of the following are used together: DATA adds the DATA element of the report to the named range (excludes heading, footing, and column titles). TITLE adds the TITLE element of the report to the named range (includes all column titles). Multiple elements can be added to the same named range. rangename The name assigned to the output in the Excel workbook Copyright 2009, Information Builders. Slide 20 FOCUS and WebFOCUS Output Formats EXCEL Named Ranges TABLE FILE GGSALES PRINT PRODUCT DATE UNITS BY REGION BY DOLLARS ON TABLE SET PAGE-NUM OFF ON TABLE SET BYDISPLAY ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * UNITS=IN,SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT,FONT='ARIAL', SIZE=9,COLOR='BLACK', BACKCOLOR='NONE',STYLE=NORMAL,$ TYPE=DATA,IN-RANGES='RegionalSales', $ TYPE=TITLE,STYLE=BOLD, IN-RANGES='RegionalSales', $ ENDSTYLE END Copyright 2009, Information Builders. Slide 21 FOCUS and WebFOCUS Output Formats EXL2K LANDSCAPE and BORDER Options StyleSheet Options: ORIENTATION=LANDSCAPE BORDER=ON are now supported for EXL2K report output. The BORDER attribute supports the same options as currently available for FORMAT PDF except for border options available in Adobe PDF but not available in Microsoft Excel: Border line width: Excel 2003 does not have an option for specifying a number to precisely set the border line width (thickness) in points. Borders with grooves and ridges: Excel 2003 does not have an option for specifying grooved or ridged borders. FORMAT EXL2K does not support the GRID=ON parameter. Available in Release 7.6.9 Copyright 2009, Information Builders. Slide 22 FOCUS and WebFOCUS Output Formats EXL2K LANDSCAPE and BORDER Options TABLE FILE CAR PRINT 'CAR.BODY.RETAIL_COST' 'CAR.BODY.DEALER_COST' 'CAR.BODY.SALES' 'CAR.BODY.SEATS' BY 'CAR.ORIGIN.COUNTRY' BY 'CAR.COMP.CAR' ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $ TYPE=REPORT, BORDER-TOP=LIGHT, BORDER-BOTTOM=LIGHT, BORDER-LEFT=LIGHT, BORDER-RIGHT=LIGHT, FONT='ARIAL', SIZE=9, $ TYPE=TITLE, STYLE=BOLD, $ TYPE=HEADING, BORDER-TOP=OFF, BORDER-BOTTOM=OFF, BORDER-LEFT=OFF, BORDER-RIGHT=OFF, SIZE=12, STYLE=BOLD, $ TYPE=FOOTING, BORDER-TOP=OFF, BORDER-BOTTOM=OFF, BORDER-LEFT=OFF, BORDER-RIGHT=OFF, SIZE=12, STYLE=BOLD, $ ENDSTYLE END Copyright 2009, Information Builders. Slide 23 FOCUS and WebFOCUS Output Formats EXL2K LANDSCAPE and BORDER Options Copyright 2009, Information Builders. Slide 24 FOCUS and WebFOCUS Output Formats EXL2K LANDSCAPE and BORDER Options Copyright 2009, Information Builders. Slide 25 PDF Output Copyright 2009, Information Builders. Slide 26 FOCUS and WebFOCUS Output Formats Compressing PDF Output Files SET FILECOMPRESS = {ON|OFF} ON Compresses PDF output files. The compressed PDF file size can be reduced to 25% of the original PDF file size. OFF Does not compress PDF output files. OFF is the default value. This command applies to PDF output only It is ignored by all other output formats Copyright 2009, Information Builders. Slide 27 FOCUS and WebFOCUS Output Formats Compressing PDF Output Files SET FILECOMPRESS=ON TABLE FILE GGSALES PRINT BUDUNITS UNITS BUDDOLLARS DOLLARS BY CATEGORY ON TABLE SUBHEAD "SALES REPORT" "**(CONFIDENTIAL)**" "December 2001 </1" ON TABLE COLUMN-TOTAL ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT PDF ON TABLE SET SQUEEZE ON ON TABLE SET STYLESHEET * TYPE=TABHEADING,JUSTIFY=CENTER, GRID=ON,BACKCOLOR=SILVER,$ ENDSTYLE END Copyright 2009, Information Builders. Slide 28 FOCUS and WebFOCUS Output Formats Respect Carriage Returns and / or Line Feeds: LINEBREAK TYPE=REPORT,LINEBREAK='type',$ REPORT is the type of report component. TYPE must be REPORT; otherwise an error will result. 'type‘ specifies that line breaks will be inserted in a report based on the following: LF Inserts a line break after each line-feed character found in all An and AnV fields. CR Inserts a line break after each carriage-return character found in all An and AnV fields. LFCR Inserts a line break after each combination of a line-feed character followed by a carriage-return character found in all An and AnV fields. CRLF Inserts a line break after each combination of a carriage-return character followed by a line-feed character found in all An and AnV fields. If An/AnV fields are included in HEADINGs (SUBHEADs, SUBFOOTs), WRAP=n attribute must be included in the Stylesheet syntax for these fields to make the LINEBREAK attribute effective. Copyright 2009, Information Builders. Slide 29 FOCUS and WebFOCUS Output Formats Respect Carriage Returns and / or Line Feeds: LINEBREAK DEFINE FILE CAR CR/A1 = HEXBYT(13, 'A1'); LF/A1 = HEXBYT(10, 'A1'); CRLF/A2 = CR || LF; ABC1/A5 = EDIT (COUNTRY, '99999'); ABC2/A10 = EDIT (COUNTRY, '$$$$$9999999999'); ABC3/A30 = ABC1 || CRLF || ABC2; ABC4/A30V = ABC1 || CRLF || ABC2; END TABLE FILE CAR PRINT ABC3 ABC4 ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,LINEBREAK='CRLF',$ ENDSTYLE END Works for PDF and EXL2K What about HTML? Copyright 2009, Information Builders. Slide 30 FOCUS and WebFOCUS Output Formats Respect Carriage Returns and / or Line Feeds: LINEBREAK … <TABLE BORDER CELLPADDING=1> <TR> <TD COLSPAN=2> <TABLE CELLPADDING=0 WIDTH="100%"><TR> <TD> PAGE 1</TD></TR></TABLE></TD> </TR> <TR> <TD VALIGN=BOTTOM> ABC3</TD> <TD VALIGN=BOTTOM> ABC4</TD> </TR> <TR> <TD> ENGLA ND</TD> <TD> ENGLA ND</TD> </TR> <TR> <TD> JAPAN </TD> <TD> JAPAN </TD> </TR> <TR> <TD> ITALY </TD> <TD> ITALY </TD> </TR> <TR> <TD> W GER MANY</TD> … Copyright 2009, Information Builders. Slide 31 FOCUS and WebFOCUS Output Formats Respect Carriage Returns and / or Line Feeds: LINEBREAK DEFINE FILE CAR CR/A1 = HEXBYT(13, 'A1'); LF/A1 = HEXBYT(10, 'A1'); CRLF/A2 = CR || LF; ABC1/A5 = EDIT (COUNTRY, '99999'); ABC2/A10 = EDIT (COUNTRY, '$$$$$9999999999'); ABC3/A30 = ABC1 || CRLF || ABC2; ABC3A/A32=STRREP(32,ABC3,2,CRLF,4,'<BR>',32,'A32'); ABC4/A30V = ABC1 || CRLF || ABC2; ABC4A/A32V=STRREP(32,ABC4,2,CRLF,4,'<BR>',32,'A32V'); END TABLE FILE CAR PRINT ABC3A ABC4A ON TABLE PCHOLD FORMAT HTML END Use Global Replacement of CRLF with <BR> or Use <PRE> tag at beginning and </PRE> at end of field Copyright 2009, Information Builders. Slide 32 FOCUS and WebFOCUS Output Formats Display Total Number of Pages in a Sort Group: BYLASTPAGE {HEADING|FOOTING} "Page <TABPAGENO of <BYLASTPAGE“ Display the number of pages of output within each sort group when a report uses the REPAGE option to reset the page numbers for each sort group. PAGE-BREAK is required on the same sort field using REPAGE or a lower level sort field. PAGE-BREAK starts a new page for each sort break. REPAGE resets the page number to 1 for each sort break. <TABPAGENO is the current page number. <BYLASTPAGE is the last page number before the REPAGE. If the REPAGE option is not used in the report, the total number of pages in the report (<TABLASTPAGE variable) is used for <BYLASTPAGE Copyright 2009, Information Builders. Slide 33 FOCUS and WebFOCUS Output Formats Display Total Number of Pages in a Sort Group: BYLASTPAGE TABLE FILE GGSALES HEADING CENTER "<PRODUCT : Page <TABPAGENO of <BYLASTPAGE " SUM UNITS BY PRODUCT NOPRINT REPAGE BY REGION PAGE-BREAK BY CATEGORY BY CITY ON TABLE PCHOLD FORMAT PDF END Copyright 2009, Information Builders. Slide 34 FOCUS and WebFOCUS Output Formats Display Total Number of Pages in a Sort Group: BYLASTPAGE Supported with styled output formats such as HTML & EXL2K Copyright 2009, Information Builders. Slide 35 FOCUS and WebFOCUS Output Formats Displaying Images stored in BLOB fields TYPE=headtype,[BY=byfield,],IMAGE=(blobfield), POSITION=(+xpos +ypos), SIZE=(width height), [PRESERVERATIO={ON|OFF}],$ TYPE=DATA, COLUMN=bloboutputfield, IMAGE=(blobfield), SIZE=(width height),[PRESERVERATIO={ON|OFF}] $ headtype HEADING, FOOTING, SUBHEAD, or SUBFOOT blobfield Is any valid column reference for the BLOB field that contain the image. BLOB field must be referenced in PRINT or LIST command BLOB field must NOT be referenced in the HEADING/FOOTING/SUBHEAD/SUBFOOT Copyright 2009, Information Builders. Slide 36 FOCUS and WebFOCUS Output Formats Displaying Images stored in BLOB fields xpos ypos Offsets from the top-left corner of HEADING, SUBHEAD, FOOTING OR SUBFOOT Specified by the UNITS parameter (default is inches). These numbers are specified with a leading plus (+) sign to indicate that they are relative to the top-left corner of the report component, as opposed to absolute page coordinates. width height Specify the dimensions to which the image is to be scaled If omitted, the original dimensions of the image are used For a report column If omitted, default size is 1 inch by 1 inch. Width of the column and spacing between the lines is automatically adjusted to accommodate the image. Copyright 2009, Information Builders. Slide 37 FOCUS and WebFOCUS Output Formats Displaying Images stored in BLOB fields bloboutputfield Designates the column to be replaced with an image (usually this will be the image field itself). Multiple report columns can contain images. PRESERVERATIO={ON|OFF} ON specifies that the aspect ratio (ratio of height to width) of the image should be preserved when it scaled to the specified SIZE. Avoids distorting the appearance of the image. The image is scaled to the largest size possible within the bounds specified by SIZE for which the aspect ratio can be maintained. OFF does not maintain the aspect ratio. OFF is the default value. Copyright 2009, Information Builders. Slide 38 FOCUS and WebFOCUS Output Formats Displaying Images stored in BLOB fields JOIN PRODUCTID IN RETAILDETAIL TO PRODUCTID IN RETAILIMAGE TABLE FILE RETAILDETAIL HEADING CENTER "Product List" " " PRINT NAME/A30 PRICE PRODIMAGE AS 'PICTURE' BY PRODUCTID NOPRINT BY NAME NOPRINT ON NAME UNDER-LINE ON TABLE SET PAGE NOPAGE ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,COLOR=BLUE,$ TYPE=HEADING, SIZE = 18, FONT = ARIAL, COLOR=RED,$ TYPE=DATA,COLUMN=PRODIMAGE,IMAGE=(PRODIMAGE),SIZE=(1 1),$ … FILENAME=RETAILIMAGE, SUFFIX=SQLMSS , $ SEGMENT=RETAILIMAGE, SEGTYPE=S0, $ FIELDNAME=PRODUCTID, ALIAS=PRODUCTID, USAGE=A5, ACTUAL=A5, $ FIELDNAME=PRODIMAGE, ALIAS=F02BLOB50000, USAGE=BLOB, ACTUAL=BLOB, MISSING=ON, $ Copyright 2009, Information Builders. Slide 39 FOCUS and WebFOCUS Output Formats Displaying Images stored in BLOB fields Copyright 2009, Information Builders. Slide 40 FOCUS and WebFOCUS Output Formats