In this section: |
Compound reports combine multiple reports into a single file. This enables you to concatenate reports with styled formats (such as PDF, HTML, PS, or EXL2K). You can also embed image files, including graphs saved as images, in a compound report.
Three types of compound reports exist:
In a Coordinated Compound Layout report, if at least one component contains data for a specific sort field value, a page is generated for that value even though some of the components may be missing. For more information about Coordinated Compound Layout reports with missing data, see Coordinated Compound Layout Reports With Missing Data.
While the length of the report will always include all of the rows of data generated by the query, the width of the report is limited by the size of the defined component container. This means that paneling is not supported for compound reports, although it is for non-compound PDF reports. For non-compound PDF documents, if the width of the report data is wider than the defined page size, a panel (or horizontal overflow page) is automatically generated. This paneling feature is not supported for compound PDF documents, so each compound component must fit within the width of the defined container in order for the report to be successfully generated. The container size is defined within each type of report.
For information about creating PDF Compound Reports with Drill Through links, see Creating a PDF Compound Report With Drill Through Links.
How to: Reference: |
Typically, you create a compound layout report by using the options in the Document Composer tool. Alternatively, you may create a compound layout report by modifying the syntax in the Text Editor tab of the Document Composer or in any text editor.
Note: For details about creating a compound layout report using the Document Composer tool, see Creating a Compound Layout Report in the Creating Compound Reports With Document Composer manual.
Syntax for a compound layout report is structured by a compound layout block, which places all of the layout information in a single block that precedes the report. This block begins with a COMPOUND LAYOUT declaration and is terminated with END. The language it contains is based on StyleSheet syntax and is parsed by the StyleSheet parser.
Tip: For details about StyleSheet syntax, see Creating and Managing a WebFOCUS StyleSheet.
The compound layout block consists of SECTION, PAGELAYOUT, and COMPONENT declarations. The general structure of the compound layout block of syntax is:
COMPOUND LAYOUT PCHOLD FORMAT format SECTION
PAGELAYOUT
COMPONENT
COMPONENT
...
PAGELAYOUT
COMPONENT
COMPONENT
...
...
END
...
COMPOUND END
Note: The available compound layout output formats are PDF, DHTML, PowerPoint, AHTML, Excel, FLEX, and APDF. The selected compound layout format will override any report output format from the COMPONENT declaration.
END signifies the end of the COMPOUND LAYOUT block whereas COMPOUND END signifies the end of the compound report.
Additionally, the syntax SET COMPONENT=report(n) is added after each component, followed by the actual WebFOCUS code to generate the report. For an example of how this syntax appears, see Creating a Compound Layout Report in the Creating Compound Reports With Document Composer manual.
This topic describes the structure of the compound layout block syntax and some examples.
A compound report section, or SECTION declaration, is a grouping of component reports within a compound report. While the current functionality only supports reports with a single section, this structure is used to support more complex reports. The SECTION declaration is mandatory when creating a compound layout report.
The SECTION syntax appears as:
SECTION=section-name, LAYOUT=ON, [MERGE=ON|OFF,] [UNITS=IN|CM|PTS,] [PAGESIZE=Style Sheet selections,] [ORIENTATION=PORTRAIT|LANDSCAPE,] [LEFTMARGIN=m,] [RIGHTMARGIN=m,] [TOPMARGIN=m,] [BOTTOMMARGIN=m,] $
where:
Note: LAYOUT=ON is the only applicable option at this time.
Note: The default value is OFF.
If the optional items, UNITS, PAGESIZE, ORIENTATION, or MARGIN are present in the SECTION declaration, they override any settings of these parameters within the component reports, global SET commands, ON TABLE SET commands, and StyleSheet keywords.
A SECTION consists of one or more PAGELAYOUT declarations, each of which group together a number of COMPONENT declarations that are laid out on that particular page of the section.
The PAGELAYOUT keyword brackets a group of COMPONENT declarations that follow, up to the next PAGELAYOUT keyword, or the end of the section.
The PAGELAYOUT syntax appears as:
PAGELAYOUT={n|ALL}, [TOPMARGIN=m,] [BOTTOMMARGIN=m,]$
where:
Note: Syntax is required even if the report only contains a single page.
PAGELAYOUT=1, $
PAGELAYOUT=ALL, $
Components included in a declaration for PAGELAYOUT=ALL appear on every page of the report output. This is useful for creating a design theme for the compound report output:
For example, the following report does not display any data:
SET COMPONENT='DfltCmpt1' TABLE FILE SYSCOLUM SUM TBNAME NOPRINT IF READLIMIT EQ 1 ON TABLE SET PREVIEW ON ON TABLE SET PAGE-NUM NOLEAD END
SET COMPONENT='DfltCmpt1' TABLE FILE GGSALES SUM UNITS NOPRINT BY PCD NOPRINT IF READLIMIT EQ 1 ON TABLE SET PREVIEW ON ON TABLE SET PAGE-NUM NOLEAD END
Note that the recommended way to create a design theme with repeating text and images on a page master is to place drawing objects on the page master. For information, see How to Draw Objects With Document Composer Syntax.
The order of COMPONENT declarations in the COMPOUND LAYOUT block must match the order in which the component reports are executed, and there must be a COMPONENT declaration for each component report.
There are two types of components: fixed and flowing. A fixed component fills the container defined by the dimension parameters on the page and, if additional data exists, it overflows onto the next page in the same fixed size in the same location. The size and location of the fixed overflow component can be customized on the overflow page (using the OVERFLOW-POSITION and OVERFLOW-DIMENSION parameters). In a flowing component, the data flows from the top of the defined component to the bottom page margin and then begins to flow again on the top page margin of the overflow page, until the data is complete. The starting postion of each type of component is defined by the POSITION parameter. The fixed or flowing aspect of the component is determined by the DIMENSION parameter. For a fixed component, the DIMENSION parameter specifies sizes for the dimensions of the bounding box. However, for a flowing component the DIMENSION parameter specifies asterisks (* *) for the dimensions.
The COMPONENT syntax appears as:
COMPONENT=component-name, TYPE=component-type, POSITION=(x y), DIMENSION=(xsize ysize), [OVERFLOW-POSITION=(x y),] [OVERFLOW-DIMENSION=(xsize ysize),] [DRILLMAP=((L1 targetreport)),] $
where:
Note: The SET syntax only tags styled reports that can participate in a compound report, so it can be placed before unstyled reports that precede the report to be named. For example, reports that generate extract files.
Note: By default, coordinates are absolute locations on the physical page. If x or y is preceded by a + or - sign, for example, (+.25 +0), the coordinate is relative to the left or top page margin.
For a fixed component, xsize and ysize must be numeric dimension sizes.
For a flowing component, xsize and ysize must both be asterisks DIMENSION = (* *).
Note: The double parentheses are required.
In this simple example using the GGSALES Master File, the MERGE keyword specifies that a Coordinated Compound Layout Report is to be generated. Since the first BY field of each component is REGION, a page will be generated for each value of REGION, with the first report (Sales) positioned at (1 1) and the second report (Units) at (6.25 1).
Enter the following syntax in the Text Editor tab of the Document Composer.
SET PAGE-NUM=OFF
COMPOUND LAYOUT PCHOLD FORMAT PDF
SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $
PAGELAYOUT=1, $
COMPONENT=Sales, TYPE=REPORT, POSITION=(1 1), DIMENSION=(4 4), $
COMPONENT=Units, TYPE=REPORT, POSITION=(6.25 1), DIMENSION=(4 4), $
END
SET COMPONENT=Sales
TABLE FILE GGSALES
"Sales report for <REGION"
" "
SUM DOLLARS/F8M
BY REGION NOPRINT
BY ST
BY CITY
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=HELVETICA, COLOR=RED, SQUEEZE=ON, $
END
SET COMPONENT=Units
TABLE FILE GGSALES
"Number of unit sales per product for <REGION"
" "
SUM CNT.UNITS AS 'Number of units sold'
BY REGION NOPRINT
BY PRODUCT
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=HELVETICA, COLOR=BLUE, SQUEEZE=ON, $
END
COMPOUND END
The following syntax is an example of what the same report might look like if the component reports were in pre-existing procedures (FOCEXECs), as indicated by R1 and R2.
SET PAGE-NUM=OFF SET SQUEEZE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $ PAGELAYOUT=1, $ COMPONENT=R1, TYPE=REPORT, POSITION=(1 1), DIMENSION=(4 4), $ COMPONENT=R2, TYPE=REPORT, POSITION=(6 1), DIMENSION=(4 4), $ END SET COMPONENT=R1 EX REPORT1 SET COMPONENT=R2 EX REPORT2 COMPOUND END
The first page of output is:
This example, using the GGSALES Master File, generates a Coordinated Compound Layout report that contains a graph and a report (by replacing the first report in the previous example with a graph). Note that a graph request with two BY fields will generate a graph for each value of the first BY field (REGION), and that these files are named by appending sequence numbers to the HOLD file name. For example, HOLD0.SVG, HOLD1.SVG, and so on.
To place these graphs into a report as a component of a Coordinated Compound Layout report, several COMPUTE commands are required to construct the name of each graph file (HOLD0.SVG, HOLD1.SVG, and so on). Additionally, a COMPUTE command will add the image files into the HEADING of the TABLE request so that they are associated with the same value of REGION, from which they were originally produced.
Enter the following syntax in the Text Editor tab of the Document Composer.
SET PAGE-NUM=OFF COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $ PAGELAYOUT=1, $ COMPONENT=Sales, TYPE=REPORT, POSITION=(0.25 1), DIMENSION=(4 4), $ COMPONENT=Fuel, TYPE=REPORT, POSITION=(7.25 1), DIMENSION=(4 4), $ END
SET COMPONENT=Sales GRAPH FILE GGSALES SUM PCT.DOLLARS BY REGION NOPRINT BY PRODUCT ON GRAPH SET LOOKGRAPH HBAR ON GRAPH HOLD AS HOLD FORMAT SVG ON GRAPH SET GRAPHSTYLE * setPlace(true); setColorMode(1); setDepthRadius(0); setDepthAngle(0); setDisplay(getO1MajorGrid(),false); setTransparentBorderColor(getFrame(),true); setDisplay(getDataText(),true); setTextFormatPreset(getDataText(),28); setFontSizeAbsolute(getDataText(),true); setFontSizeInPoints(getDataText(),9); setPlaceResize(getDataText(),0); setFontStyle(getDataText(),0); setTransparentBorderColor(getSeries(0),true); setDisplay(getO1AxisLine(),false); setFontSizeAbsolute(getO1Label(),true); setFontSizeInPoints(getO1Label(),9); setPlaceResize(getO1Label(),0); setFontSizeAbsolute(getY1Label(),true); setFontSizeInPoints(getY1Label(),9); setPlaceResize(getY1Label(),0); setTextFormatPreset(getY1Label(),28); setGridStyle(getY1MajorGrid(),3); setDisplay(getY1AxisLine(),false); setDisplay(getY1MajorGrid(),false); setDisplay(getY1Label(),false); setDataTextPosition(3); setTextString(getO1Title(),""); setTextString(getY1Title(),""); setFontStyle(getTitle(),0); END
TABLE FILE GGSALES "Percent of Sales by Product in <REGION" " " SUM COMPUTE CNTR/I4 = CNTR + 1; NOPRINT COMPUTE CNTR2/A4 = IF &FOCGRAPHCNT EQ 1 THEN ' ' ELSE FTOA(CNTR-1,'(F4)','A4'); NOPRINT COMPUTE IMG/A16 = 'HOLD'||LJUST(4,CNTR2,'A4')|| '.svg'; NOPRINT BY REGION NOPRINT ON REGION PAGE-BREAK ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * type=HEADING, IMAGE=(IMG), position=(0 0), $ TYPE=REPORT,PAGE-LOCATION=OFF,$ TYPE=REPORT, FONT=HELVETICA, COLOR=BLACK, SQUEEZE=ON, $ END
SET COMPONENT=Fuel TABLE FILE GGSALES "Sales report for <REGION" " " SUM DOLLARS/F8M BY REGION NOPRINT BY ST BY CITY ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=RED, SQUEEZE=ON, $ END COMPOUND END
The first page of output is:
In this example using the GGSALES Master File, multi-page layouts allow components to be placed in fixed locations on multiple pages. For example, a Coordinated Compound Layout report can contain component reports R1 and R2 for each value of the first sort field on the odd-numbered pages (front side), and R3 on the even-numbered pages (reverse side). Additionally, you can place the same heading that contains a logo and some text with the embedded value of the first sort field at the top of each side.
For the heading report, create a procedure (named HEADER.FEX), and enter the following syntax:
TABLE FILE GGSALES " " "Report package for <REGION" BY REGION NOPRINT ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, SIZE=20, $ TYPE=REPORT, IMAGE=poweredbyibi.gif, POSITION=(+.25 +.25), $ TYPE=HEADING, LINE=2, ITEM=1, POSITION=4, $ END
We will use components R1 and R2 from the previous example. If you did not already do so, save them as REPORT1.FEX and REPORT2.FEX. Enter the following syntax as the R3 report component, by creating a procedure named REPORT3.FEX.
TABLE FILE GGSALES "Report R3 for <REGION" BY REGION NOPRINT SUM DOLLARS BY ST ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=GREEN, $ END
From the Text Editor tab of the Document Composer, enter the following syntax specifying that the R1 and R2 report components appear on page 1. The R3 report component appears on page 2, and the heading report will appear on all pages of the document.
SET PAGE-NUM=OFF SET SQUEEZE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $ PAGELAYOUT=ALL, $ COMPONENT=HEADER, TYPE=REPORT, POSITION=(1 1), DIMENSION=(4 4), $ PAGELAYOUT=1, $ COMPONENT=R1, TYPE=REPORT, POSITION=(1 3), DIMENSION=(4 4), $ COMPONENT=R2, TYPE=REPORT, POSITION=(6 3), DIMENSION=(4 4), $ PAGELAYOUT=2, $ COMPONENT=R3, TYPE=REPORT, POSITION=(4 3), DIMENSION=(4 4), $ END
SET COMPONENT=HEADER EX HEADER SET COMPONENT=R1 EX REPORT1 SET COMPONENT=R2 EX REPORT2 SET COMPONENT=R3 EX REPORT3 COMPOUND END
Page 1 of the output is:
Page 2 of the output is:
A common type of report contains a fixed layout at the top of the page, followed by a report containing detail records of unfixed length. For example, a brokerage statement may contain the customer name and address, an asset-allocation graph, and a comparison of the portfolio with market indexes at the top, followed by a list of securities held in the account. If the list of securities overflows the first page, we would like it to continue on the second page, underneath the common heading which appears on all pages (a logo, account number, page number for instance). The OVERFLOW-POSITION and OVERFLOW-DIMENSION syntax enables us to specify where on the overflow page the report continues and what its maximum length on each overflow page should be. (Note that its width should not vary from one page to the next.)
The following example, using the GGSales Master File, demonstrates how you can use OVERFLOW-POSITION and OVERFLOW-DIMENSION to reposition the second report component (R2) so that it begins below the first component on the initial page, and two inches below the top of the page on subsequent pages. Note that this leaves enough space for the header report component (HEADER) at the top of each page.
Additionally, PAGELAYOUT=ALL forces the HEADER component to appear at the top of each overflow page.
Enter the following syntax in the Text Editor tab of the Document Composer.
SET PAGE-NUM=OFF COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=Example, LAYOUT=ON, MERGE=OFF, $ PAGELAYOUT=1, $ COMPONENT=R1, TYPE=REPORT, POSITION=(1.5 2), DIMENSION=(8 3), $ COMPONENT=R2, TYPE=REPORT, POSITION=(.5 5), DIMENSION=(8 5), OVERFLOW-POSITION=(.5 2), OVERFLOW-DIMENSION=(8 8.5), $ PAGELAYOUT=ALL, $ COMPONENT=HEADER, TYPE=REPORT, POSITION=(1.25 1), DIMENSION=(6 1), $ END
SET COMPONENT=R1 TABLE FILE GGSALES HEADING CENTER "Report 1" "Sales Summary by Category" " " SUM UNITS BUDUNITS DOLLARS BUDDOLLARS BY CATEGORY ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, SQUEEZE=ON, $ END
SET COMPONENT=R2 TABLE FILE GGSALES HEADING CENTER "Report 2" "Sales Detail Report" " " SUM UNITS BUDUNITS DOLLARS BUDDOLLARS BY CATEGORY BY PRODUCT BY REGION ON CATEGORY UNDER-LINE ON PRODUCT SUB-TOTAL ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, SQUEEZE=ON, $ END
SET COMPONENT=HEADERTABLE FILE GGSALES
HEADING
"Gotham Grinds sales to Information Builders, October 1997"
BY CATEGORY NOPRINT
ON TABLE HOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, IMAGE=gotham.gif, POSITION=(3.25 .25), DIMENSION=(2 .75), $
END
The first page of output is:
The second page of output is:
A variety of objects can be drawn on the page to enhance a report. The currently supported objects include Lines, Boxes, Static text strings, and Images.
The syntax for drawing these objects may appear in the StyleSheet of a report, but they may also be included within a PAGELAYOUT grouping in the COMPOUND LAYOUT declarations. The syntax for each drawing object is described below.
OBJECT=LINE, POSITION=(x1 y1), ENDPOINT=(x2 y2), [BORDER=b,] [BORDER-COLOR=c,] [BORDER-STYLE=s,]$
Optionally, the border attributes BORDER, BORDER-COLOR, and BORDER-STYLE follow the existing BORDER syntax, as shown below:
OBJECT=LINE, POSITION=(1 1), ENDPOINT=(8 1), BORDER=HEAVY, BORDER-COLOR=RED, BORDER-STYLE=DASHED, $
OBJECT=BOX, POSITION=(x y), DIMENSION=(xdim ydim), BACKCOLOR=c, [BORDER=b,] [BORDER-COLOR=bc,] [BORDER-STYLE=bs,] $
Tip: The background color c, specifies the color with which the box is filled and can be any valid color. For example, yellow or RGB(200 200 200).
As in the BORDER syntax, the individual sides of the box can be styled separately. For example:
OBJECT=BOX, POSITION=(1 1), DIMENSION=(2 3), BACKCOLOR=YELLOW, BORDER=HEAVY, BORDER-TOP-COLOR=RED, BORDER-BOTTOM-COLOR=BLUE, $
Note that, as in the BORDER syntax, attributes of lines or boxes that are not explicitly specified have the following defaults: color: black, style: solid, width BORDER attribute: medium.
You can format the text displayed in the text object by including markup tags within the text portion of the text object. A report with markup tags in a text object is called a markup report. A markup report can be generated as a PDF, DHTML, or PPT output file. WebFOCUS supports a subset of HTML tags and its own page numbering tags. To activate these markup tags (so that they are treated as formatting elements instead of displaying as text), add the attribute MARKUP=ON to the string object. For additional information, see Text Formatting Markup Tags for a Text Object.
To draw a static text string at position (x y), enter the following syntax:
OBJECT=STRING, POSITION=(X Y), TEXT='any text you like', [MARKUP={ON|OFF},] [FONT=f,] [SIZE=sz,] [STYLE=st,] [COLOR=c,] [WRAP=ON, DIMENSION=(xdim ydim),] [LINESPACING=linesoption ,] $
where:
Note: By default, coordinates are absolute locations on the physical page. If x or y is preceded by a + or - sign, for example, (+.25 +0), the coordinate is relative to the left or top page margin.
Note: If your text contains any open caret characters (<), you must put a blank space after each open caret that is part of the text. If you do not, everything following the open caret will be interpreted as the start of a markup tag and will not display as text.
LINESPACING={SINGLE|1.5LINES|DOUBLE}
or
LINESPACING=type(value)
where:
Type | Value | Example |
---|---|---|
MULTIPLE | The percentage by which to increase or decrease the line space. | LINESPACING=MULTIPLE(1.2) increases line space by 20 percent. |
MIN | The minimum line space (in the unit specified by UNITS parameter) needed to fit the largest font on the line. | LINESPACING=MIN(0.5) provides a minimum line space of 0.5 inch when UNITS=IN. |
EXACT | The fixed line space (in the unit specified by UNITS parameter) that WebFOCUS does not adjust. | LINESPACING=EXACT(.3) provides a fixed line space of 0.3 inch when UNITS=IN. |
Optionally, you may specify the FONT, SIZE, STYLE, and COLOR attributes as you would for any textual object in a report. For example:
OBJECT=STRING, POSITION=(1 1), TEXT='Hello world!', FONT=TIMES, SIZE=12, STYLE=BOLD, COLOR=RED, $
Note: A position of a string is measured from its bottom left to allow strings with different heights to be aligned to a common base-line. However, if WRAP=ON is present, it indicates that the string should be wrapped to a bounding box whose top left corner is at (x y) and whose dimensions are (xdim ydim). In this case, the top left of the text string is positioned at point (x y).
OBJECT=IMAGE, IMAGE=file, POSITION=(x y), DIMENSION=(xdim ydim), $
Note: The image file name=file can be any image file valid in a PDF report. POSITION is used as with a conventional image, and DIMENSION is used in place of the SIZE attribute of a conventional image.
The following example shows how drawing objects can be placed inside the COMPOUND LAYOUT syntax using the GGSALES Master File. Note that a drawing object, like a COMPONENT, appears on the page whose PAGELAYOUT declaration it follows.
SET PAGE-NUM=OFF SET SQUEEZE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $ PAGELAYOUT=1, $ COMPONENT=Sales, TYPE=REPORT, POSITION=(1 1), DIMENSION=(4 4), $ COMPONENT=Budget, TYPE=REPORT, POSITION=(6.25 1), DIMENSION=(4 4), $ OBJECT=IMAGE, IMAGE=gglogo.gif, POSITION=(1 4.5), DIMENSION=(1 1), $ OBJECT=BOX, POSITION=(1 1), DIMENSION=(5 3), BACKCOLOR=GOLDENROD, $ END SET COMPONENT=Sales TABLE FILE GGSALES "Sales report for <REGION" " " SUM DOLLARS BY REGION NOPRINT BY CATEGORY ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, STYLE=BOLD, $ END SET COMPONENT=Budget TABLE FILE GGSALES "Budget report for <REGION" " " SUM BUDDOLLARS BY REGION NOPRINT BY CATEGORY ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=BLUE, $ END COMPOUND END
The first page of output is:
Note: A drawing object will not be drawn unless there is at least one COMPONENT in its PAGELAYOUT.
The SET LAYOUTGRID command can be used as an aid to manually develop report layouts. Displaying grids superimposes a light one-inch by one-inch grid on the page so that the locations of the various report components can be verified. Currently, the grid only works in inches.
Enter the following syntax to display grids:
SET LAYOUTGRID=ON
Note: If your text contains any open caret characters (<), you must put a blank space after each open caret that is part of the text. If you do not, everything following the open caret will be interpreted as the start of a markup tag and will not display as text.
Font Properties
The font tag supports three attributes: face, size, and color (where the color must be specified as the hexadecimal number code for the color):
<font face="font" size=[+|-]n color=color_code>text</font>
For example:
<font face="New Century Schoolbook">Test1</font> <font face="Times" size=12>test2</font> <font face="Times New Roman" color=#0000FF size=+4>Test3</font> <font size=-2 face="Times New Roman" color=#0000FF >Test4</font>
Text Styles
The supported text styles are bold, italic, underline, and superscript:
Bold: <b>text</b>
Italic: <I>text</I>
Underline: <u>text</u>
Superscript: <sup>text</sup>
Line Breaks
The line break tag after a portion of text begins the next portion of text on a new line. Note that there is no closing tag for a line break:
<br>
Text Alignment
The alignment options pertain to wrapped text as well as specified line breaks:
Left Justification: <left>text</left>
Right Justification: <right>text</right>
Center Justification: <center>text</center>
Full Justification: <full>text</full>
Unordered (Bullet) List
The unordered (ul) list tag encloses a bullet list. Each item is enclosed in a list item tag (li). The start tag and end tag for the list must each be on its own line. Each list item must start on a new line:
<ul> <li>list item1</li> <li>list item2</li> . . . </ul>
By default, the bullet type is disc. You can also specify circle or square:
<ul type=disc>
<ul type=circle>
<ul type=square>
Ordered (Number or Letter) List
The ordered (ol) list tag encloses a list in which each item has a consecutive number or letter. Each item is enclosed in a list item tag (li). The start tag and end tag for the list must each be on its own line. Each list item must start on a new line:
<ol> <li>list item1</li> <li>list item2</li> . . . </ol>
By default, Arabic numerals (type=1) are used for the ordering of the list. You can specify the following types of order:
Arabic numerals (the default): <ol type=1>
Lowercase letters: <ol type=a>
Uppercase letters: <ol type=A>
Lowercase Roman numerals: <ol type=I>
Uppercase Roman numerals: <ol type=I>
Page Numbering and Dates
There are two pseudo-HTML tags for embedding page numbers in text on a Page Master for a Coordinated Compound Layout report:
Current page number: <ibi-page-number/>
Total number of pages: <ibi-total-pages/>
Note that when MARKUP=ON, space is allocated for the largest number of pages, so there may be a wide gap between the page number and the following text. To resolve the space issue, do not insert markup tags in the text object that has the page numbering tags and turn MARKUP=OFF.
To display a date in the report output, insert a WebFOCUS date variable in a text object on a Page Master (such as &DATEtrMDYY) in the text object.
Note: Text objects can be long HTML strings, and they need to be continuous, without line breaks. However, in the following example, the text object must be shown within the page margins. In order to nake the object visually manageable, the text object in the following example takes advantage of the WebFOCUS continuation character, the backslash (\), to present the object on multiple lines. The continuation character is normally not used or needed because you enter the text object as one long line in the request.
The following request displays a text object with markup tags in a PDF output file:
SET PAGE-NUM=OFF SET LAYOUTGRID=ON TABLE FILE GGSALES BY REGION NOPRINT ON TABLE PCHOLD AS LINESP1 FORMAT PDF ON TABLE SET STYLE * type=report, size=8, $ object=string, position=(1 1), dimension=(7 3), wrap=on, markup=on, linespacing=multiple(3), text='<b><font face="Arial" size=12>This paragraph is triple-spaced \ (LINESPACING=MULTIPLE(3)):</font></b> <full>Our <i>primary</I> goal for \ fiscal 2006 was to accelerate our transformation to customer centricity. \ In this letter, I'd like to give you an update on this work, which \ contributed to the 22-percent increase in earnings from continuing \ operations we garnered for fiscal 2006. Since the past is often prologue \ to the future, I'd like to describe how customer centricity is influencing \ not only our goals for fiscal 2007, but also our long-term plans. At Gotham \ Grinds, customer centricity means treating each customer as a unique \ individual, meeting their needs with end-to-end solutions, and engaging \ and energizing our employees to serve them.</full>', $ ENDSTYLE END
In this request:
‘This paragraph is triple-spaced (LINESPACING=MULTIPLE(3)):’
The markup for this formatting is:
<b><font face="Arial" size=12>This paragraph is triple-spaced (LINESPACING=MULTIPLE(3)):</font></b>
Note, however, that the image has been resized to fit the page so the font may appear smaller:
<full>Our ... </full>
<i>primary</I>
The output is:
The following request places a line on the page master between the header report and the component reports and places a line and a text string on the bottom of each page:
SET PAGE-NUM=OFF SET SQUEEZE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF SECTION=S1, LAYOUT=ON, MERGE=ON, ORIENTATION=LANDSCAPE, $ PAGELAYOUT=ALL, $ COMPONENT=HEADER, TYPE=REPORT, POSITION=(1 1), DIMENSION=(4 4), $ OBJECT=STRING, POSITION=(1 6.6), MARKUP=ON, TEXT='<font face="Arial" color=#0000FF size=12> Page <ibi-page-number/> </font> ', WRAP=ON, DIMENSION=(4 4),$ OBJECT=LINE, POSITION=(1 2.5), ENDPOINT=(9.5 2.5), BORDER-COLOR=BLUE,$ OBJECT=LINE, POSITION=(1 6.5), ENDPOINT=(9.5 6.5), BORDER-COLOR=BLUE,$ PAGELAYOUT=1, $ COMPONENT=R1, TYPE=REPORT, POSITION=(1 3), DIMENSION=(4 4), $ COMPONENT=R2, TYPE=REPORT, POSITION=(6 3), DIMENSION=(4 4), $ PAGELAYOUT=2, $ COMPONENT=R3, TYPE=REPORT, POSITION=(4 3), DIMENSION=(4 4), $ END
SET COMPONENT=HEADER TABLE FILE GGSALES " " "Report package for <REGION" BY REGION NOPRINT ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, SIZE=20, $ TYPE=REPORT, IMAGE=gglogo.gif, POSITION=(+.25 +.25), $ TYPE=HEADING, LINE=2, ITEM=1, POSITION=1.5, $ END SET COMPONENT=R1 TABLE FILE GGSALES "Sales report for <REGION" " " SUM DOLLARS/F8M BY REGION NOPRINT BY ST BY CITY ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=RED, SQUEEZE=ON, $ END SET COMPONENT=R2 TABLE FILE GGSALES "Number of unit sales per product for <REGION" " " SUM CNT.UNITS AS 'Number of units sold' BY REGION NOPRINT BY PRODUCT ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=BLUE, SQUEEZE=ON, $ END SET COMPONENT=R3 TABLE FILE GGSALES "Report R3 for <REGION" BY REGION NOPRINT SUM DOLLARS BY ST ON TABLE SET STYLE * TYPE=REPORT, FONT=HELVETICA, COLOR=GREEN, $ END COMPOUND END
The first page of output is:
The second page of output has the same drawing objects:
A Coordinated Compound Layout report is comprised of individual component reports or graphs with a common first sort field. The compound procedure generates an output document with a separate page (or set of pages) for each individual value of the sort field, with the embedded components segmented to display the data that corresponds to that sort field value.
A Coordinated Compound Layout report page is generated in the designated page layout for every sort field value found in at least one of the component reports, presenting the appropriate data for those components where data exists for that value, and presenting an empty component report where data does not exist.
The way an empty component is represented on the report page is dependent on how the component positioning is defined within the Coordinated Compound Layout report. Components can be defined with absolute positioning or relative to other components in the layout. If the empty component and subsequent components on the page are defined with absolute positioning, the empty component report will display as blank space in the designated location. If relative positioning is defined between the empty component and subsequent components, the subsequent components will float up on the page, and no empty space will be displayed in the area defined for the empty component.
In compound reports with relative positioning defined between reports, when an empty report is encountered, the report following the empty report is positioned vertically relative to the bottom of the last non-empty report and horizontally relative to the page margin. This means that when a report contains no data, the subsequent report will float up (vertically) and begin relative to the previous report but it will not move horizontally on the page relative to either of the previous reports
Using POSITION = (X Y), the placement of a report is designated by the left coordinate (X = horizontal) and the top coordinate (Y = vertical). Each of these coordinates can be defined independently as relative to the previous report or in a fixed position on the page.
To define positioning so that the report floats up on the page to replace the empty report but is anchored in a fixed left position on the page, you can define the Y coordinate (top) as relative and anchor the X coordinate (left). To anchor one of the position coordinates, change the reference from a relative position (+/-) to an absolute position. For example:
Both coordinates relative: POSITION(+0.003 +0.621)
Anchor horizontal / flow vertical: POSITION( 0.520 +0.621)
You do not need to change or add any WebFOCUS syntax to your request in order to take advantage of this feature. You will, however, want to pay attention to how you select and relate the data within your coordinated components to ensure you are generating the desired output.
In this example, we will create a set of statements reporting the outstanding inventory orders for a select group of stores. Each store may have unfilled orders in any of three inventory categories: Food, Coffee, and Gifts.
To demonstrate how this works we will first build a set of data files: a header file containing contact information for the selected set of stores, and transaction files for each inventory category. We are selecting specific data to demonstrate how this will work when different component reports are empty.
After creating the data files, we will build four component reports, one to display the header information and one for each inventory category.
Finally, we will bring them together in a Coordinated Compound Layout report that merges all of this information into a single statement page for each store.
The following four data files will be created from a join of the GGORDER and GGSALES data sources:
Data File Created |
Type of Information Included |
Stores included |
---|---|---|
GGHDR |
Store information |
R1019, R1020, R1040, R1041 |
GG1 |
Order transactions for Coffee |
R1019, R1040, R1088 |
GG2 |
Order transactions for Food |
R1019, R1020, R1041, R1088 |
GG3 |
Order transactions for Gifts |
R1019, R1020, R1040, R1088 |
The APP HOLD, JOIN, and DEFINE commands are:
APP HOLD baseapp JOIN GGORDER.ORDER01.STORE_CODE IN GGORDER TO UNIQUE GGSTORES.STORES01.STORE_CODE IN GGSTORES AS J1 END DEFINE FILE GGORDER PRODUCT_CATEGORY/A15=IF (PRODUCT_DESCRIPTION IN ('Biscotti','Croissant','Scone')) THEN 'Food' ELSE IF (PRODUCT_DESCRIPTION IN ('French Roast','Hazelnut','Kona')) THEN 'Coffee' ELSE 'Gifts'; END
The following procedure creates the data source GGHDR:
TABLE FILE GGORDER SUM FST.STORE_NAME FST.ADDRESS1 FST.ADDRESS2 FST.CITY FST.STATE FST.ZIP BY STORE_CODE WHERE STORE_CODE IN ('R1019','R1020','R1040','R1041'); ON TABLE NOTOTAL ON TABLE HOLD AS GGHDR FORMAT FOCUS INDEX 'STORE_CODE' END
The following procedure creates the data source GG1:
TABLE FILE GGORDER PRINT QUANTITY UNIT_PRICE PACKAGE_TYPE SIZE VENDOR_NAME PRODUCT_CATEGORY BY STORE_CODE BY ORDER_DATE BY PRODUCT_DESCRIPTION WHERE ( PRODUCT_CATEGORY EQ 'Coffee' ) AND ( ORDER_DATE GE '09/01/97' ); WHERE STORE_CODE IN ('R1019','R1040','R1088'); ON TABLE HOLD AS GG1 FORMAT FOCUS INDEX 'STORE_CODE' END
The following procedure creates the data source GG2:
TABLE FILE GGORDER PRINT QUANTITY UNIT_PRICE PACKAGE_TYPE SIZE VENDOR_NAME PRODUCT_CATEGORY BY STORE_CODE BY ORDER_DATE BY PRODUCT_DESCRIPTION WHERE ( PRODUCT_CATEGORY EQ 'Food' ) AND ( ORDER_DATE GE '09/01/97' ); WHERE STORE_CODE IN ('R1019','R1020','R1041','R1088'); ON TABLE HOLD AS GG2 FORMAT FOCUS INDEX 'STORE_CODE' END
The following procedure creates the data source GG3:
TABLE FILE GGORDER PRINT QUANTITY UNIT_PRICE PACKAGE_TYPE SIZE VENDOR_NAME PRODUCT_CATEGORY BY STORE_CODE BY ORDER_DATE BY PRODUCT_DESCRIPTION WHERE ( PRODUCT_CATEGORY EQ 'Gifts' ) AND ( ORDER_DATE GE '09/01/97' ); WHERE STORE_CODE IN ('R1019','R1020','R1040','R1088'); ON TABLE HOLD AS GG3 FORMAT FOCUS INDEX 'STORE_CODE' END
The following procedure, GGHDR.FEX, creates the first report component for the Coordinated Compound Layout report from the GGHDR data source. This will function as a header for each page of the Compound Layout report. The shared sort field for all of the report components is STORE_CODE. On each page of the PDF output file, this procedure lists the name and address of one store:
TABLE FILE GGHDR BY STORE_CODE NOPRINT HEADING "<STORE_NAME " "<ADDRESS1 " "<ADDRESS2 " "<CITY , <STATE <ZIP " " " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$ TYPE=HEADING, SIZE=10, STYLE=BOLD, COLOR=BLUE,$ ENDSTYLE END
The following procedure, GGRPT1.FEX, creates the second report component for the Coordinated Compound Layout report. For the same store code value in the header report, it displays data from the GG1 data source about the product category Coffee:
TABLE FILE GG1 SUM QUANTITY UNIT_PRICE FST.PACKAGE_TYPE AS ',Package' FST.SIZE AS ',Size' VENDOR_NAME BY STORE_CODE AS 'Store' BY PRODUCT_DESCRIPTION HEADING "<PRODUCT_CATEGORY" " " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$ TYPE=DATA, SIZE=10,$ TYPE=TITLE, STYLE=BOLD, SIZE=10,$ TYPE=HEADING, SIZE=10, STYLE=BOLD, COLOR=RED,$ ENDSTYLE END
The following procedure, GGRPT2.FEX, creates the third report component for the Coordinated Compound Layout report. For the same store code value in the header report, it displays data from the GG2 data source about the product category Food:
TABLE FILE GG2 SUM QUANTITY UNIT_PRICE FST.PACKAGE_TYPE AS ',Package' FST.SIZE AS ',Size' VENDOR_NAME BY STORE_CODE BY PRODUCT_DESCRIPTION HEADING "<PRODUCT_CATEGORY" " " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$ TYPE=DATA, SIZE=10,$ TYPE=TITLE, STYLE=BOLD, SIZE=10,$ TYPE=HEADING, SIZE=10, STYLE=BOLD, COLOR=RED,$ ENDSTYLE END
The following procedure, GGRPT3.FEX, creates the final report component for the Coordinated Compound Layout report. For the same store code value in the header report, it displays data from the GG3 data source about the product category Gifts:
TABLE FILE GG3 SUM QUANTITY UNIT_PRICE FST.PACKAGE_TYPE AS ',Package' FST.SIZE AS ',Size' VENDOR_NAME BY STORE_CODE BY PRODUCT_DESCRIPTION HEADING "<PRODUCT_CATEGORY" " " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$ TYPE=DATA, SIZE=10,$ TYPE=TITLE, STYLE=BOLD, SIZE=10,$ TYPE=HEADING, SIZE=10, STYLE=BOLD, COLOR=RED,$ ENDSTYLE END
The following procedure, GGCMPD.FEX, combines the four components into a Coordinated Compound Layout report. The reports and relative positioning for each component is presented in the following diagram:
The Coordinated Compound Layout syntax is:
SET HTMLARCHIVE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF UNITS=IN, $ SECTION=section1, LAYOUT=ON, MERGE=ON, ORIENTATION=PORTRAIT, PAGESIZE=Letter, $ PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, $ COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(0.667 1.083), DIMENSION=(3.417 1.412), $ COMPONENT='report2', TEXT='report2', TOC-LEVEL=2, POSITION=(0.837 2.584), DIMENSION=(* *), $ COMPONENT='report3', TEXT='report3', TOC-LEVEL=2, POSITION=(-0.006 +0.084), DIMENSION=(* *), RELATIVE-TO='report2', RELATIVE-POINT=BOTTOM-LEFT, POSITION-POINT=TOP-LEFT, $ COMPONENT='report4', TEXT='report4', TOC-LEVEL=2, POSITION=(+0.010 +0.080), DIMENSION=(* *), RELATIVE-TO='report3', RELATIVE-POINT=BOTTOM-LEFT, POSITION-POINT=TOP-LEFT, $ END SET COMPONENT='report1' -INCLUDE GGHDR.FEX SET COMPONENT='report2' -INCLUDE GGRPT1.FEX SET COMPONENT='report3' -INCLUDE GGRPT2.FEX SET COMPONENT='report4' -INCLUDE GGRPT3.FEX COMPOUND END
On the first page of the PDF output file, all components have data and appear on the report output:
On the second page, report GGRPT2.FEX did not retrieve any data for the store in the header. Therefore, the Coffee component is missing. Note that because Component 3 and 4 are positioned RELATIVE-TO the components defined above them in the Compound Layout syntax, the Food and Gifts components move up instead of leaving blank space where the Coffee component would have been:
On page 5, the header report did not retrieve any data for a store code value present in the other three components. A page is still generated for this store code. Since the second component (Coffee report) was positioned absolutely in the Compound Layout syntax, not RELATIVE-TO the first component (header report), the space where the header report would have been is left blank:
In this section: How to: Reference: |
Using compound layout syntax, you can generate a Table of Contents for a PDF compound report.
The Table of Contents can be presented as either PDF bookmarks displayed by the Adobe Reader, or as a Table of Contents page placed at the beginning of the document, or both. Both the Table of Contents entries and the bookmarks provide links to each of the components and included sort fields. These links position the reader on the page where the Table of Contents link is located.
You include a component in the Table of Contents at a specific level by defining a TOC Description and TOC Level in the compound layout syntax for the component. Within any of the report components, a tree of BY field values will be presented (indented one level within the component entry where BYTOC is designated).
The Table of Contents (TOC) page shows a summary of the contents of the document, along with page numbers, and can be printed with the document. The entries in the Table of Contents enable you to easily navigate to a particular section while viewing the document on-line. The entries can link to any component of the compound output (page, report, or graph), any object (image, text box) within the compound report, and vertical sort field values (BY field values) within each component report.
The actual content of the Table of Contents is represented as a text element in the compound layout syntax. When using a Table of Contents page, you can:
Note: If the Table of Contents overflows to more than one page at run time, the remaining content is executed with the same size and dimensions as the first page until the entire TOC has been output.
You can generate bookmarks, a Table of Contents page, or both by including the BOOKMARKS and/or TOC object in the compound layout syntax. Then in the component definitions, specify the Table of Contents level and description and, optionally, the BYTOC levels.
TOC Attributes
COMPOUND LAYOUT PCHOLD FORMAT PDF [OBJECT=BOOKMARKS, $] [OBJECT=TOC, NAME='text1', TEXT='<font face="font1" size=sz1>Table of Contents</font>', MARKUP=ON, TOC-NUMBERING={OFF|ON}, POSITION=(x y), [TOC-FILL=DOTS,] DIMENSION=(m n), font='font2', color={color|RGB(r g b)}, size=sz2, METADATA=' TOCTITLE: Table of Contents', $]
where:
Component Entries
COMPONENT=component1, TITLE='title1', TOC-LEVEL=n, [BYTOC=m,] POSITION=(x y),DIMENSION=(a b), $
where:
0 = the object is not shown in the Table of Contents.
1 = the object is shown as a first level item in the Table of Contents.
2 = the object is shown as a second level item in the Table of Contents and so on.
General Notes
BYTOC Notes
The following example has two component reports. Both PDF bookmarks and a Table of Contents page are generated. Each component is at TOC level 1 and each has two levels of BY fields under the Level 1 entries:
COMPOUND LAYOUT PCHOLD FORMAT PDF OBJECT=BOOKMARKS, $ OBJECT=TOC, NAME='text1', TEXT='<font face="ARIAL" size=10>Table of Contents</font>', MARKUP=ON, TOC-NUMBERING=ON, POSITION=(0.854 0.854), DIMENSION=(7.000 9.500), font='ARIAL', color=RGB(0 0 0), size=10, METADATA=' TOCTITLE: Table of Contents', $ SECTION=S1, LAYOUT=ON, MERGE=OFF, ORIENTATION=PORTRAIT, $ PAGELAYOUT=1, $ COMPONENT=report1, TEXT='Sales By Product', TOC-LEVEL=1, BYTOC=2, POSITION=(1 1), DIMENSION=(* *), $ COMPONENT=report2, TEXT='Sales By Region', TOC-LEVEL=1, BYTOC=2, POSITION=(+0.00 +0.519), DIMENSION=(* *), RELATIVE-TO='report1', RELATIVE-POINT=BOTTOM-LEFT, POSITION-POINT=TOP-LEFT, $ END SET COMPONENT=report1 TABLE FILE GGSALES SUM DOLLARS/F8M BY CATEGORY BY PRODUCT BY REGION BY ST HEADING "Sales by Category" ON TABLE HOLD FORMAT PDF END SET COMPONENT=report2 TABLE FILE GGSALES SUM DOLLARS/F8M BY REGION BY ST BY CATEGORY BY PRODUCT HEADING "Sales by Region" ON TABLE HOLD FORMAT PDF END COMPOUND END
The output shows that each component reports is at Table of Contents level 1 and has two levels of sort fields under it. For the Sales by Product report, the BY fields are Category and Product. For the Sales by Region report, the BY fields are Region and State. Each entry in the Table of Contents is a link to the page containing that value:
Clicking any entry on the Table of Contents page or in the bookmarks pane opens the page containing that entry. For example, clicking the Sales by Region/Southeast entry opens the following page:
How to: |
Compound reports combine multiple reports into a single PDF or PS file. The first PDF or PS report defines the format for the concatenated report, enabling you to intersperse intermediate reports of other formats into one encompassing report. Using compound reports, you can gather data from different data sources and combine reports into one governing report that runs each request and concatenates the output into a single PDF or PS file.
You can then run or distribute the report with ReportCaster, which displays the compound PDF report in Adobe Adobe Reader or sends the compound PS report directly to a printer. See the ReportCaster documentation for details about this product.
For information about creating Drill Through PDF Compound Reports, see Creating a PDF Compound Report With Drill Through Links. For information about creating Excel Compound Reports, see Creating a Compound Excel Report.
For a compound report that may contain different report types, use the syntax
SET COMPOUND= {OPEN|CLOSE} [NOBREAK]
or
ON TABLE SET COMPOUND {OPEN|CLOSE}
Note that when you are using this syntax, you must also include the following code to identify the display format of each of the reports to be concatenated:
ON TABLE {PCHOLD|HOLD|SAVE} [AS name] FORMAT formatname
If all of the reports in the compound set are of the same type, either PDF or PS, you can use the following, more compact, syntax
ON TABLE {PCHOLD|HOLD|SAVE} [AS name] FORMAT {PDF|PS} {OPEN|CLOSE} [NOBREAK]
where:
You can use NOBREAK selectively in a request to control which reports are displayed on the same page.
Note:
The following illustrates how to combine three separate PDF reports into one by creating a compound report. Notice that:
Note that in this example, all reports are set to PDF format. However, when you create a compound report, only the first report must be in either PDF or PS format. Subsequent reports can be in any styled format. For an illustration, see How to Embed Graphics in a Compound Report.
Report 1:
SET PAGE-NUM=OFF TABLE FILE CENTORD HEADING "Sales Report" " " SUM LINEPRICE BY PRODCAT ON TABLE SET STYLE * TYPE=HEADING, SIZE=18, $ ENDSTYLE ON TABLE PCHOLD FORMAT PDF OPEN NOBREAK END
Report 2:
TABLE FILE CENTORD HEADING "Inventory Report" " " SUM QUANTITY BY PRODCAT ON TABLE SET STYLE * TYPE=HEADING, SIZE=18, $ ENDSTYLE ON TABLE PCHOLD FORMAT PDF NOBREAK END
Report 3:
TABLE FILE CENTORD HEADING "Cost of Goods Sold Report" " " SUM LINE_COGS BY PRODCAT ON TABLE SET STYLE * TYPE=HEADING, SIZE=18, $ ENDSTYLE ON TABLE PCHOLD FORMAT PDF CLOSE END
The output displays as a PDF report. Because the syntax for reports 1 and 2 contain the NOBREAK command, the three reports appear on a single page. (Without NOBREAK, each report displays on a separate page.)
You can embed a graphic, such as a logo or a WebFOCUS graph captured as a GIF file, in a compound report. The graphic file must be embedded in a particular report within the set of compound reports.
To save a graph as a graphic image, include the following syntax in your graph request:
HOLD FORMAT GIF
For details on saving a graph as an image file, see Creating a Graph.
To embed a graphic in a compound report, you must identify the image file in the StyleSheet declaration of the report in which you want to include it, along with size and position specifications if desired. For details about embedding and positioning graphics in reports, see Adding an Image to a Report.
This request generates a compound report from three different report types (PDF, HTML, and EXL2K), and embeds a graph in each report. Notice that each graph is saved as a GIF file in the graph request. The graph is then identified, sized, and positioned within the StyleSheet declaration (TYPE=REPORT, IMAGE=graphname...) of the report in which it is being embedded). Variations on the SET COMPOUND= syntax (OPEN, NOBREAK, CLOSE) combine the three reports on the same page. Key lines of code are highlighted in the following request.
Report 1:
SET GRMERGE = ON
GRAPH FILE SHORT
SUM PROJECTED_RETURN AS 'Return on Investment'
BY HOLDER
ACROSS CONTINENT
ON GRAPH SET LOOKGRAPH 3D_BAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH HOLD AS SLSGRPH1 FORMAT GIF
END
SET COMPOUND='OPEN NOBREAK'
TABLE FILE SHORT
SUM PROJECTED_RETURN AS 'Return on Investment'
BY CONTINENT
BY HOLDER
HEADING
"Investment Report"
" "
ON TABLE SET STYLE * TYPE=DATA, BACKCOLOR=( BY=B2 'SILVER' 'WHITE' ), $ TYPE=HEADING, SIZE=14, STYLE=BOLD, $ TYPE=REPORT, IMAGE=SLSGRPH1.gif, POSITION=(4.5 0.5), SIZE=(3.5 2.5), $ ENDSTYLE ON TABLE PCHOLD FORMAT PDF END
Report 2:
GRAPH FILE TRADES
SUM AMOUNT
BY CONTINENT
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH HOLD AS TRDSGR1 FORMAT GIF
END
SET COMPOUND=NOBREAK TABLE FILE TRADES SUM AMOUNT AS 'Amount' BY CONTINENT AS 'Continent' BY REGION AS 'Region' HEADING "Trades Report" " " ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * TYPE=DATA, BACKCOLOR=( BY=B2 'SILVER' 'WHITE' ), $ TYPE=HEADING, SIZE=14, STYLE=BOLD, $ TYPE=REPORT, IMAGE=TRDSGR1.gif, POSITION=(4 3), SIZE=(4 2.5), $ ENDSTYLE ON TABLE PCHOLD FORMAT HTML END
Report 3:
GRAPH FILE SHORT
SUM BALANCE
BY CONTINENT
ON GRAPH SET LOOKGRAPH 3D_BAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET STYLE *
TYPE=DATA, COLOR=RED,$
ENDSTYLE
ON GRAPH HOLD AS BALGR1 FORMAT GIF
END
SET COMPOUND=CLOSE TABLE FILE SHORT SUM BALANCE AS 'Balance' BY CONTINENT AS 'Continent' BY REGION AS 'Region' HEADING "Balance by Region" " " ON TABLE SET STYLE * TYPE=DATA, BACKCOLOR=( BY=B2 'SILVER' 'WHITE' ), $ TYPE=HEADING, SIZE=14, STYLE=BOLD, $ TYPE=REPORT, IMAGE=BALGR1.gif, POSITION=(4 6), SIZE=(4 2.5), $ ENDSTYLE ON TABLE PCHOLD FORMAT EXL2K END
The output is:
Reference: |
Excel Compound Reports generate multiple worksheet reports using the EXL2K output format.
The syntax of Excel Compound Reports 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, whether sent to the client using PCHOLD or saved in a file using HOLD, is generated in Microsoft Web Archive format. This format is labeled Single File Web Page in the Excel Save As dialog. Excel provides the conventionally given file suffixes: .mht or .mhtml. WebFOCUS uses the same .xht suffix that is used for EXL2K reports. Since the output is always a single file, it can be easily distributed using ReportCaster.
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. Excel Compound Reports 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 or PCHOLD 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.)
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 GGSALES HEADING "Report 1: Coffee - Budget" SUM BUDDOLLARS BUDUNITS COLUMN-TOTAL AS 'Total' BY REGION IF CATEGORY EQ Coffee ON TABLE PCHOLD FORMAT EXL2K OPEN NOBREAK ON TABLE SET STYLE * type=report, font=Arial, size = 10, style=normal, $ type=title, style=bold, $ type=heading, size=12, style=bold, color=blue, $ type=grandtotal, style=bold, $ END
TABLE FILE GGSALES HEADING " " "Report 2: Coffee - Actual " SUM DOLLARS UNITS COLUMN-TOTAL AS 'Total' BY REGION IF CATEGORY EQ Coffee ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * type=report, font=Arial, size=10, style=normal, $ type=grandtotal, style=bold, $ type=heading, size=12, style=bold, color=blue, $ END
TABLE FILE GGSALES HEADING "Report 3: Food - Budget" SUM BUDDOLLARS BUDUNITS COLUMN-TOTAL AS 'Total' BY REGION IF CATEGORY EQ Food ON TABLE PCHOLD FORMAT EXL2K NOBREAK ON TABLE SET STYLE * type=REPORT, font=Arial, size=10, style=normal, $ type=HEADING, style=bold, size=12, color=blue, $ type=title, style=bold, $ type=grandtotal, style=bold, $ END
TABLE FILE GGSALES HEADING " " "Report 4: Food - Actual" SUM DOLLARS UNITS COLUMN-TOTAL AS 'Total' BY REGION IF CATEGORY EQ Food ON TABLE PCHOLD FORMAT EXL2K CLOSE ON TABLE SET STYLE * type=report, font=Arial, size=10, $ type=title, style=bold, $ type=heading,size=12, style=bold, color=blue,$ type=grandtotal, style=bold, $ END
The output is:
WebFOCUS |