Starting in FOCUS 7.6.1, you can generate report output in PowerPoint format, preserve leading and internal blanks in HTML and EXL2K report output, create a structured HOLD file that retains information about the structure of the original data source, use Excel named ranges, identify null values in EXL2K report output, create Excel table of contents and compound reports, display alphanumeric fields with line break characters on multiple lines, and create HTML reports with absolute positioning.
How to: |
Report output can be styled and saved as a PowerPoint presentation. Each report page becomes a separate slide in the PowerPoint file.
ON TABLE {HOLD|SAVE} [AS name] FORMAT PPT
where:
Assigns a name to the PowerPoint file. The file extension is ppt. The default name is HOLD.
The following request creates a two-page report using the MOVIES data source:
TABLE FILE MOVIES HEADING CENTER "PowerPoint Report Output" "Page <TABPAGENO" " " PRINT TITLE BY DIRECTOR WHERE DIRECTOR NE ' ' ON TABLE SAVE AS baseapp/MOVIE2 FORMAT PPT ON TABLE SET STYLE * type=report, style=bold, color=black, backcolor=yellow, $ type=tabheading, style=bold, color=black, colspan=2, backcolor=yellow, $ type=data, backcolor=aqua, $ ENDSTYLE END
The output consists of two slides in a presentation named movie2.ppt. The first report page becomes the first slide.
The second report page becomes the second slide.
How to: |
By default, HTML browsers and Excel remove leading and trailing blanks from text and compress multiple internal blanks to a single blank.
If you want to preserve leading and internal blanks in HTML and EXL2K report output, you can issue the SET SHOWBLANKS=ON command.
Even if you issue this command, trailing blanks will not be preserved except in heading, subheading, footing, and subfooting lines that use the default heading or footing alignment.
In a FOCEXEC, on the command line, or in a profile use the following syntax
SET SHOWBLANKS = {OFF|ON}
ON TABLE SET SHOWBLANKS {OFF|ON}
In a request, use the following syntax
ON TABLE SET SHOWBLANKS {OFF|ON}
where:
Removes leading blanks and compresses internal blanks in HTML and EXL2K report output.
Preserves leading and internal blanks in HTML and EXL2K report output. Also preserves trailing blanks in heading, subheading, footing, and subfooting lines that use the default heading or footing alignment.
The following request creates a virtual field that adds leading blanks to the value ACTION and both leading and internal blanks to the values TRAIN/EX and SCI/FI in the CATEGORY field. It also adds trailing blanks to the value COMEDY:
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 HOLD FORMAT HTML ON TABLE SET STYLE * GRID=OFF,$ TYPE=REPORT, FONT=COURIER NEW,$ ENDSTYLE END
With SHOWBLANKS OFF, these additional blanks are removed:
With SHOWBLANKS ON, the additional leading and internal blanks are preserved. Note that trailing blanks are not preserved:
How to:
Reference: |
Structured HOLD Files facilitate migration of data sources and reports between operating environments.
Other HOLD formats capture data from the original sources and may retain some implicit structural elements from the request itself. However, they do not propagate most of the information about the original data sources accessed and their inter-relationships to the HOLD Master File or data source. Structured HOLD files, however, extract the data to a structure that parallels the original data sources. Subsequent requests against the HOLD file can use these retained data relationships to recreate the same types of relationships in other environments or in other types of data sources.
A Structured HOLD File can be created in ALPHA, BINARY, or FOCUS format:
In all cases the HOLD file contains all of the original segment instances required to provide the complete report based on the TABLE request itself. Regardless of the display command used in the original request (PRINT, LIST, SUM, COUNT), the Structured HOLD File is created as if the request used PRINT. Aggregation is ignored.
The HOLD file contains either all of the fields in the structure identified by the request that are used to satisfy the request, or all of the display fields and BY fields. The file does not contain DEFINE fields not specifically referenced in the request. It does contain all fields needed to evaluate any DEFINE fields referenced in the request.
Structured HOLD files are only supported for TABLE and TABLEF commands. They can be created anywhere a HOLD file is supported. You must activate Structured HOLD files in a specific request by issuing the ON TABLE SET EXTRACT command in the request prior to creating the Structured HOLD File.
ON TABLE SET EXTRACT {ON|*|OFF}
where:
Activates Structured HOLD Files for this request and extracts all fields mentioned in the request.
Activates Structured HOLD Files for this request and indicates that a block of extract options follows. For example, you can exclude specific fields from the Structured HOLD File.
Deactivates Structured HOLD files for this request. OFF is the default value.
Before issuing the HOLD command, activate Structured HOLD Files for the request by issuing the ON TABLE SET EXTRACT command described in How to Activate Structured HOLD Files for a Request. Then issue the HOLD command to create the Structured HOLD File:
[ON TABLE] {HOLD|PCHOLD} [AS name] FORMAT {ALPHA|BINARY|FOCUS}
where:
Is the name of the HOLD file. If omitted, the name becomes HOLD by default.
Is ALPHA, BINARY or FOCUS
Note: You can issue a SET command to set the default HOLD format to either ALPHA or BINARY:
SET HOLDFORMAT=ALPHA SET HOLDFORMAT=BINARY
To specify options for creating the extract, such excluding specific fields, use the * option of the SET EXTRACT command:
ON TABLE SET EXTRACT * EXCLUDE = (fieldname1, fieldname2, fieldname3, ..., fieldnamen),$ FIELDS={ALL|EXPLICIT},$ ENDEXTRACT ON TABLE HOLD AS name FORMAT {ALPHA|BINARY|FOCUS}
where:
Excludes the specified fields from the HOLD file.
Is required syntax for delimiting elements in the extract block.
Includes all real fields and all DEFINE fields that are used in running the request.
Includes only those real fields and DEFINE fields that are in the display list or the BY sort field listing. DEFINE fields that are not explicitly referenced, and fields that are used to evaluate DEFINEs, are not included.
Ends the extract block.
TABLE FILE EMPLOYEE PRINT LAST_NAME FIRST_NAME JOBCODE ED_HRS BY DEPARTMENT BY HIGHEST SALARY ON TABLE SET EXTRACT ON ON TABLE HOLD FORMAT ALPHA END
This request produces the following HOLD Master File:
FILENAME=HOLD , SUFFIX=FIX , $ SEGMENT=EMPINFO, SEGTYPE=S0, $ FIELDNAME=RECTYPE, ALIAS=R, USAGE=A3, ACTUAL=A3, $ FIELDNAME=LAST_NAME, ALIAS='LN', USAGE=A15, ACTUAL=A15, $ FIELDNAME=FIRST_NAME, ALIAS='FN', USAGE=A10, ACTUAL=A10, $ FIELDNAME=DEPARTMENT, ALIAS='DPT', USAGE=A10, ACTUAL=A10, $ FIELDNAME=ED_HRS, ALIAS='OJT', USAGE=F6.2, ACTUAL=A06, $ SEGMENT=PAYINFO, SEGTYPE=S0, PARENT=EMPINFO, $ FIELDNAME=RECTYPE, ALIAS=1, USAGE=A3, ACTUAL=A3, $ FIELDNAME=SALARY, ALIAS='SAL', USAGE=D12.2M, ACTUAL=A12, $ FIELDNAME=JOBCODE, ALIAS='JBC', USAGE=A3, ACTUAL=A03, $
Note the RECTYPE field generated for ALPHA or BINARY Structured HOLD files. Each record in the HOLD file begins with the RECTYPE to indicate the segment to which it belonged in the original structure. The root segment has RECTYPE=R. The RECTYPEs for other segments are sequential numbers assigned in top to bottom, left to right order.
Following are the first several records in the HOLD file:
R STEVENS ALFRED PRODUCTION 25.00 1 11000.00A07 1 10000.00A07 R SMITH MARY MIS 36.00 1 13200.00B14 R JONES DIANE MIS 50.00 1 18480.00B03 1 17750.00B02 R SMITH RICHARD PRODUCTION 10.00 1 9500.00A01 1 9050.00B01
TABLE FILE EMPLOYEE PRINT LAST_NAME FIRST_NAME JOBCODE ED_HRS BY DEPARTMENT BY HIGHEST SALARY ON TABLE SET EXTRACT ON ON TABLE HOLD FORMAT FOCUS END
This request produces the following HOLD Master File:
FILENAME=HOLD , SUFFIX=FOC , $ SEGMENT=EMPINFO, SEGTYPE=S0, $ FIELDNAME=LAST_NAME, ALIAS='LN', USAGE=A15, $ FIELDNAME=FIRST_NAME, ALIAS='FN', USAGE=A10, $ FIELDNAME=DEPARTMENT, ALIAS='DPT', USAGE=A10, $ FIELDNAME=ED_HRS, ALIAS='OJT', USAGE=F6.2, $ SEGMENT=PAYINFO, SEGTYPE=S0, PARENT=EMPINFO, $ FIELDNAME=SALARY, ALIAS='SAL', USAGE=D12.2M, $ FIELDNAME=JOBCODE, ALIAS='JBC', USAGE=A3, $
The following request reconstitutes the original FOCUS data source from the Structured HOLD File created in Creating a Structured HOLD File in ALPHA Format:
TABLE FILE HOLD PRINT LAST_NAME FIRST_NAME JOBCODE ED_HRS BY DEPARTMENT BY HIGHEST SALARY ON TABLE SET EXTRACT ON ON TABLE HOLD AS RECONST FORMAT FOCUS END
This request produces the following Master File:
FILENAME=RECONST , SUFFIX=FOC , $ SEGMENT=EMPINFO, SEGTYPE=S0, $ FIELDNAME=LAST_NAME, ALIAS='LN', USAGE=A15, $ FIELDNAME=FIRST_NAME, ALIAS='FN', USAGE=A10, $ FIELDNAME=DEPARTMENT, ALIAS='DPT', USAGE=A10, FIELDNAME=ED_HRS, ALIAS='OJT', USAGE=F6.2, $ SEGMENT=PAYINFO, SEGTYPE=S0, PARENT=EMPINFO, $ FIELDNAME=SALARY, ALIAS='SAL', USAGE=D12.2M, $ FIELDNAME=JOBCODE, ALIAS='JBC', USAGE=A3, $
The following request prints the report output:
TABLE FILE RECONST PRINT LAST_NAME FIRST_NAME JOBCODE ED_HRS BY DEPARTMENT BY HIGHEST SALARY END
The output is:
DEPARTMENT SALARY LAST_NAME FIRST_NAME JOBCODE ED_HRS ---------- ------ --------- ---------- ------- ------ MIS $27,062.00 CROSS BARBARA A17 45.00 $25,775.00 CROSS BARBARA A16 45.00 $21,780.00 BLACKWOOD ROSEMARIE B04 75.00 $18,480.00 JONES DIANE B03 50.00 MCCOY JOHN B02 .00 $17,750.00 JONES DIANE B02 50.00 $13,200.00 SMITH MARY B14 36.00 $9,000.00 GREENSPAN MARY A07 25.00 $8,650.00 GREENSPAN MARY B01 25.00 PRODUCTION $29,700.00 BANNING JOHN A17 .00 $26,862.00 IRVING JOAN A15 30.00 $24,420.00 IRVING JOAN A14 30.00 $21,120.00 ROMANS ANTHONY B04 5.00 $16,100.00 MCKNIGHT ROGER B02 50.00 $15,000.00 MCKNIGHT ROGER B02 50.00 $11,000.00 STEVENS ALFRED A07 25.00 $10,000.00 STEVENS ALFRED A07 25.00 $9,500.00 SMITH RICHARD A01 10.00 $9,050.00 SMITH RICHARD B01 10.00
This request excludes the SALARY field used for sequencing.
TABLE FILE EMPLOYEE PRINT LAST_NAME FIRST_NAME JOBCODE ED_HRS BY DEPARTMENT BY HIGHEST SALARY ON TABLE SET EXTRACT * EXCLUDE=(SALARY),$ ENDEXTRACT ON TABLE HOLD FORMAT FOCUS END
This request produces the following HOLD Master File:
FILENAME=HOLD , SUFFIX=FOC , $ SEGMENT=EMPINFO, SEGTYPE=S0, $ FIELDNAME=LAST_NAME, ALIAS='LN', USAGE=A15, $ FIELDNAME=FIRST_NAME, ALIAS='FN', USAGE=A10, $ FIELDNAME=DEPARTMENT, ALIAS='DPT', USAGE=A10, $ FIELDNAME=ED_HRS, ALIAS='OJT', USAGE=F6.2, $ SEGMENT=PAYINFO, SEGTYPE=S0, PARENT=EMPINFO, $ FIELDNAME=JOBCODE, ALIAS='JBC', USAGE=A3, $
Structured HOLD files contain all original segment instances required to complete the TABLE or TABLEF request. Regardless of the verb used in the original request (PRINT, LIST, SUM, or COUNT), the structured HOLD file will be created as if the verb was PRINT.
Specifically, the extract file contains the following elements:
Note that fields referenced multiple times in a request are included only once in the HOLD file.
Note: If a group member is specifically excluded (EXCLUDE) or not referenced, its GROUP is not added to the extract Master File (this applies to nested and overlapping groups as well). If a GROUP and its elements are all named in a request, the GROUP is not added as a real field in the extract HOLD file.
Structural Notes
SQL Optimization Notes
BY/ACROSS/FOR Notes
Formatting Notes
DEFINE FILE CAR COUNTRY/A25=COUNTRY; END
DBA Notes
Reconstituting Extract Files
How to: |
The SAVB command now supports FORMAT INTERNAL, which prevents padding of alphanumeric fields and enables you to supply format overrides for integer and packed fields that should not be padded with zeros.
When you create a SAVB file, no Master File is created. In addition, you can supply your own DCB attributes, such as record format and record length, by issuing a TSO ALLOCATE, DYNAM ALLOCATE, or CMS FILEDEF command prior to creating the output file.
SET HOLDLIST = PRINTONLY TABLE FILE filename display_commandfieldname/[In|Pn.d].. ON TABLE SAVB AS name FORMAT INTERNAL END
where:
Causes your report request to propagate the output file with only the specified fields displaying in the report output. If you do not issue this setting, an extra field containing the padded field length is included in the output file.
Specifies formats for integer and packed fields for which you wish to suppress padding. These formats override the ACTUAL formats used for the display formats in the Master File.
Note that floating point double-precision (D) and floating pointing point single-precision (F) fields are not affected by SAVB FORMAT INTERNAL.
Saves the SAVB file without padding for specified integer and packed decimal fields.
How to: Reference: |
An Excel Named Range is a name assigned to a specific group of cells within an Excel worksheet that can be easily referenced by FOCUS applications. The FOCUS StyleSheet language facilitates the generation of Named Ranges.
The use of Excel Named Ranges provides many benefits, including the following:
To create Excel Named Ranges, use
TYPE=type, IN-RANGES=rangename, $
where:
Identifies the FOCUS 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).
Note: Multiple elements can be added to the same named range.
Is the name assigned to the output in the Excel workbook your application is creating, and is also the name that will be referenced by other FOCUS applications.
This example creates one report in one worksheet of an Excel workbook. The code specific to Excel Named Ranges appears in bold in the following syntax.
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 HOLD 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
The Excel output is:
The name assigned to this Excel Named Range is RegionalSales. If additional rows of data are added, or columns of data are inserted, the named range will stretch to contain both new and existing data.
Excel Named Ranges are supported for the following Excel formats:
EXL2K, EXL2K FORMULA, EXL2K TEMPLATE
Excel Named Ranges are not supported for the following Excel formats:
EXL2K BYTOC, EXCEL PIVOT
Excel Named Ranges are not supported with any report syntax that produces discontinuous data or uses columnar references that span multiple columns, which includes the following:
ACROSSCOLUMN, RECAP, RECOMPUTE, SUBHEAD, SUBFOOT, SUBTOTAL, SUB-TOTAL,
How to: |
When a report is formatted as EXL2K, and null values are retrieved for one or more fields, blank spaces are displayed by default in each cell of the report output for the empty (null) fields. This behavior is the result of SET EMPTYCELLS ON being set by default in the background of all EXL2K reports. If you want to identify null values with something other than blank spaces, a character string can be used to populate all empty fields in a report.
Outside of a report request, use the following syntax
SET NODATA = character_string SET EMPTYCELLS = [ON|OFF]
In a report request, use the following syntax
ON TABLE SET NODATA character_string ON TABLE SET EMPTYCELLS [ON|OFF]
where:
Is the string of characters displayed in the cells of the report for each field where null values are retrieved from the database. The 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. SET EMPTYCELLS OFF must also be specified to make the SET NODATA command effective.
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.
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.
The following syntax utilizes the default behavior of ON TABLE SET EMPTYCELLS ON, which is set in the background:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE HOLD FORMAT EXL2K END
The following output displays empty spaces in the cells of the report for each field where null values are retrieved from the database:
The following syntax utilizes the SET NODATA command:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET NODATA 'n/a' ON TABLE SET EMPTYCELLS OFF ON TABLE HOLD FORMAT EXL2K END
Note: If you do not add SET EMPTYCELLS OFF, the SET NODATA command will be ignored.
The following output displays 'n/a' in the cells of the report for each field where null values are retrieved from the database:
The following syntax turns off the default SET EMPTYCELLS behavior and does not use SET NODATA, which makes it impossible to distinguish null values from zero quantities:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET EMPTYCELLS OFF ON TABLE HOLD FORMAT EXL2K END
The following output displays zeros in the cells of the report for each field where either null values are retrieved from the database or the quantity is zero:
How to: Reference: |
PDF files created with HOLD FORMAT PDF present a challenge if you work in an MVS or VM environment and use UNIX-based systems as the server for Adobe or as an intermediate transfer point.
The end of each PDF file has a table containing the byte offset, including line termination characters, of each PDF object in the file. The offsets indicate that each line is terminated by two characters, a carriage return and a line feed, which is the standard Windows text file format. However, records in a UNIX text file are terminated by one character, a line feed only. When using default settings, the offsets in a PDF file will be incorrect, causing an error when Acrobat attempts to open the file. If the file is then transferred in BINARY mode to Windows, it cannot be opened in Acrobat for Windows, as the carriage-return character was not inserted.
One solution has been to transfer the file to the UNIX system in text mode and then transfer in text mode to the Windows system, as the carriage return is added by the transfer facility when transferring to Windows.
If that is not possible or desirable, you can use the SET PDFLINETERM=SPACE command to facilitate binary transfer to Windows from an ASCII-based UNIX system. This command causes an extra space character to be appended to each record of the PDF output file. This extra space acts as a placeholder for the expected carriage return character and makes the object offsets in the file correct when it is transferred from MVS or VM to a UNIX system. This enables a UNIX server to open a PDF file in that environment.
Note: A text mode transfer is always required when transferring a text file from a mainframe to any other environment (Windows, ASCII Unix, or EBCDIC Unix).
In a profile, a FOCEXEC, or from the command line, issue the following command:
SET PDFLINETERM={STANDARD|SPACE}
In a TABLE request, issue the following command:
ON TABLE SET PDFLINETERM {STANDARD|SPACE}
where:
Creates a PDF file without any extra characters. This file will be a valid PDF file if transferred in text mode to a Windows machine, but not to a UNIX machine. If subsequently transferred from a UNIX machine to a Windows machine in text mode, it will be a valid PDF file on the Windows machine.
Creates a PDF file with an extra space character appended to each record. This file will be a valid PDF file if transferred in text mode to a UNIX machine, but not to a Windows machine. If subsequently transferred from an ASCII UNIX machine to a Windows machine in binary mode, it will be a valid PDF file on the Windows machine.
The following chart will assist you in determining the correct setting to use, based on your environment:
Transferring from MVS or VM to: |
SET PDFLINETERM= |
---|---|
EBCDIC UNIX (text transfer) |
SPACE |
ASCII UNIX (text transfer) |
SPACE |
ASCII UNIX (text); then to Windows (binary) |
SPACE |
UNIX (text); then to Windows (text) |
STANDARD |
Directly to Windows (text) |
STANDARD |
How to: Reference: |
Excel Table of Contents (TOC) is a feature that enables you to generate a multiple worksheet report in which a separate worksheet is generated for each value of the first BY field in the FOCUS report.
Note: This feature can be used only with Excel 2002 or higher releases because it requires the Web Archive file format, which was not available in Excel 2000 and earlier releases.
Only a single BY field is allowed in an EXL2K Table of Contents report.
ON TABLE HOLD FORMAT EXL2K BYTOC
Since only one level of TOC is allowed for EXL2K reports, the optional number following the BYTOC keyword can only be 1.
The SET COMPOUND syntax, which precedes the TABLE command, may also be used to specify that a TOC be created:
SET COMPOUND=BYTOC
Since a TOC report is burst into worksheets according to the value of the first BY field in the report, the report must contain at least one BY field. The bursting field may be a NOPRINT field.
Note: FORMULA is not supported with bursting.
SET COMPOUND=BYTOC TABLE FILE CAR PRINT SALES BY COUNTRY NOPRINT BY CAR ON TABLE HOLD 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
The output is:
Reference: |
Excel Compound Reports is a feature which enables you to generate multiple worksheet reports using the EXL2K output format.
The syntax of this feature is identical to that of PDF Compound Reports. By default, each of the component reports from the compound report is placed in a new Excel worksheet (analogous to a new page in PDF). If the NOBREAK keyword is used, the next report follows the current report on the same worksheet (analogous to starting the report on the same page in PDF).
Output is generated in Microsoft's Web Archive format. This format is labeled Single File Web Page in Excel's Save As dialog. Excel provides the conventionally given file types: MHT or MHTML. FOCUS uses the same XHT file type that is used for EXL2K reports.
The components of an Excel compound report can be FORMULA or PIVOT reports (subject to the restrictions). They cannot be Table of Contents (TOC) reports.
Note: Excel 2002 (Office XP) or higher must be installed. This feature will not work with earlier versions of Excel since they do not support the Web Archive file format.
As with PDF, the keywords OPEN, CLOSE, and NOBREAK are used to control Excel compound reports. They can be specified with the HOLD command or with a separate SET COMPOUND command.
NOBREAK may appear with OPEN on the first report, or alone on a report between the first and last reports. (Using CLOSE is irrelevant, since it refers to the placement of the next report, and no report follows the final report on which CLOSE appears.)
ON TABLE HOLD FORMAT EXL2K OPEN
ON TABLE HOLD AS MYHOLD FORMAT EXL2K OPEN NOBREAK
ON TABLE HOLD FORMAT EXL2K NOBREAK FORMULA
ON TABLE HOLD FORMAT EXL2K CLOSE PIVOT PAGEFIELDS COUNTRY
SET COMPOUND = OPEN
SET COMPOUND = 'OPEN NOBREAK'
SET COMPOUND = NOBREAK
SET COMPOUND = CLOSE
TYPE=REPORT, TITLETEXT='Summary Report', $
Excel limits the length of worksheet titles to 31 characters. The following special characters cannot be used: ':', '?', '*', and '/'.
The HOLD FORMAT syntax used in the first component report in a compound report applies to all subsequent reports in the compound report, regardless of their format.
SET PAGE-NUM=OFF TABLE FILE CAR HEADING "Sales Report" " " SUM SALES BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Sales Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD AS EX1 FORMAT EXL2K OPEN END
TABLE FILE CAR HEADING "Inventory Report" " " SUM RC BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Inv. Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD FORMAT EXL2K END
TABLE FILE CAR HEADING "Cost of Goods Sold Report" " " SUM DC BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Cost Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD FORMAT EXL2K CLOSE END
The output for each tab in the Excel worksheet is:
SET PAGE-NUM=OFF TABLE FILE CAR HEADING "Sales Report" " " PRINT RCOST BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Sales Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD AS PIV1 FORMAT EXL2K OPEN END
TABLE FILE CAR HEADING "Inventory Report" " " PRINT SALES BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Inv. Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD AS PPPP FORMAT EXL2K PIVOT PAGEFIELDS TYPE SEATS CACHEFIELDS MODEL MPG RPM END
TABLE FILE CAR SUM RCOST BY COUNTRY BY CAR BY MODEL BY TYPE BY SEATS SUMMARIZE ON MODEL SUB-TOTAL ON TABLE HOLD AS XFOCB FORMAT EXL2K FORMULA END
TABLE FILE CAR HEADING "Cost of Goods Sold Report" " " PRINT DCOST BY COUNTRY ON TABLE SET STYLE * type=report, titletext='Cost Rpt', $ type=heading, size=18, $ ENDSTYLE ON TABLE HOLD AS ONE FORMAT EXL2K CLOSE PIVOT PAGEFIELDS RCOST CACHEFIELDS MODEL TYPE SALES ACCEL SEATS END
The output for each tab in the Excel worksheet is:
In this example, the first two reports are on the first worksheet, and the last two reports are on the second worksheet, since NOBREAK appears on both the first and third reports.
TABLE FILE CAR HEADING "Report 1: England" PRINT DCOST BY COUNTRY BY CAR IF COUNTRY EQ ENGLAND ON TABLE HOLD FORMAT EXL2K OPEN NOBREAK ON TABLE SET STYLE * type=report, color=red, $ type=data, backcolor=yellow, $ type=heading, color=blue, $ END
TABLE FILE CAR HEADING " " " " "Report 2: France" PRINT RCOST BY COUNTRY IF COUNTRY EQ FRANCE ACROSS SEATS ON TABLE HOLD FORMAT EXL2K ON TABLE SET STYLE * type=report, color=lime, backcolor=fuschia, style=bold, $ type=title, color=black, style=bold+italic, $ type=heading, backcolor=black, $ END
TABLE FILE CAR FOOTING "Report 3 - All" PRINT SALES BY COUNTRY BY CAR ON TABLE HOLD FORMAT EXL2K NOBREAK ON TABLE SET STYLE * type=report, backcolor=yellow, style=bold, $ type=title, color=blue, $ type=footing, backcolor=aqua, $ END
TABLE FILE CAR HEADING " " " " "Report 4" PRINT SALES BY COUNTRY BY CAR ON TABLE HOLD FORMAT EXL2K CLOSE ON TABLE SET STYLE * type=report, color=yellow, backcolor=black, style=bold, $ END
The output is:
How to: |
Using StyleSheet attributes, you can display An (character) and AnV (varchar) fields that contain line breaks on multiple lines in a PDF or PostScript report. Line breaks can be based on line feeds, carriage returns, or a combination of both. If you do not add these StyleSheet attributes, all line feed and carriage return formatting within these fields will be ignored.
TYPE=REPORT,LINEBREAK='type',$
where:
Is the required component for the LINEBREAK attribute.
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.
Note: The report output must be formatted as PDF or PostScript.
The following request defines an alphanumeric named ANLB field with a semi-colon in the middle. The CTRAN function then replaces the semi-colon with a carriage return character and stores this string in a field named ANLBC. On the report output, this field displays on two lines:
DEFINE FILE EMPLOYEE ANLB/A40 ='THIS IS AN An FIELD;WITH A LINE BREAK.'; ANLBC/A40 = CTRAN(40, ANLB, 094, 013 , ANLBC); END TABLE FILE EMPLOYEE PRINT LAST_NAME ANLBC WHERE LAST_NAME EQ 'BLACKWOOD' ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,LINEBREAK='CR',$ ENDSTYLE END
The output is:
LAST_NAME ANLBC BLACKWOOD THIS IS AN An FIELD WITH A LINE BREAK.
The following request defines an alphanumeric named ANLB field with a semi-colon in the middle. The CTRAN function then replaces the semi-colon with a carriage return character and stores this string in a field named ANLBC. In the subfoot, this field displays on two lines:
DEFINE FILE EMPLOYEE ANLB/A40 ='THIS IS AN An FIELD;WITH A LINE BREAK.'; ANLBC/A40 = CTRAN(40, ANLB, 094, 013 , ANLBC); END TABLE FILE EMPLOYEE PRINT FIRST_NAME BY LAST_NAME WHERE LAST_NAME EQ 'BLACKWOOD' ON LAST_NAME SUBFOOT " " " <ANLBC " ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,LINEBREAK='CR',$ ENDSTYLE END
The output is:
LAST_NAME FIRSTNAME BLACKWOOD ROSEMARIE THIS IS AN An FIELD WITH A LINE BREAK.
How to: Reference: |
Format DHTML provides HTML output that has most of the features normally associated with output formatted for printing such as PDF or PostScript output. You can create an HTML file (.htm) or a Web Archive file (.mht). The type of output file produced is controlled by the value of the HTMLARCHIVE parameter.
Some of the features supported by format DHTML are:
SET HTMLARCHIVE = {ON|OFF}
where:
Creates output in Web Archive format. The file type of the output file is MHT.
Creates output in HTML format The file type of the output file is HTM. OFF is the default value.
[ON TABLE] HOLD [AS name] FORMAT DHTML
where:
Specifies the name of the output file. The extension will be htmHTML if SET HTMLARCHIVE is OFF or mhtMHTif SET HTMLARCHIVE is ON.
The following example creates a DHTML file that has an image with absolute positioning:
SET HTMLARCHIVE = OFF TABLE FILE GGSALES SUM UNITS BY CATEGORY BY PRODUCT ON TABLE SUBHEAD "Report on Units Sold" " " " " " " " " " " ON TABLE SET PAGE-NUM OFF ON TABLE HOLD FORMAT DHTML ON TABLE SET STYLE * TYPE=TABHEADING,IMAGE=c:\images\GOTHAM.GIF, POSITION=(.25 .25), SIZE=(.5 .5), $ ENDSTYLE END
The output shows that the look and positioning are the same as they would be for a PDF report:
Information Builders |