In this section: |
How to: |
Reference: |
A common technique in business reporting is to create two related reports:
Drill Through provides a way to easily relate the data in these two types of reports. For example, a user scanning a summary report account may see an unusual figure in one of the accounts, requiring examination of the specific data behind that figure.
There are two forms of Compound Drill Through reports:
In both types of Compound Drill Through reports, the syntax for creating hyperlinks between reports within the PDF file are exactly the same.
Using Drill Down, you can construct a summary report in which clicking a hyperlink displays detail data. A Drill Down is implemented dynamically. Clicking a hyperlink causes a new report to run. The detail report typically displays only the detail data for a selected field on the summary report.
In contrast, Drill Through reports are static. Drill Through creates a PDF document that contains the summary report plus the detail report, with the detail report containing all the detail data for designated fields in the summary report. Clicking a Drill Through hyperlink navigates internally in the PDF file. No additional reports are run. You can save the PDF file to disk or distribute it using ReportCaster. When opened with Adobe Reader, it retains its full Drill Through functionality.
Drill Through provides flexibility in the appearance of reports and location of hyperlinks:
You can use Drill Through with other WebFOCUS features:
To create a Drill Through in a PDF Compound Layout report:
To create a Drill Through in a PDF Compound Report:
TYPE=type, [element,] [styling_attributes,] DRILLTHROUGH={DOWN|FIRST}(link_fields) , $
where:
A column reference can be the name of a field or any of the other symbols valid in WebFOCUS StyleSheets syntax (for example, Bn, Cn, Pn, Nn, An, subscripted field name, and so on).
The order of the syntax is similar to Drill Down syntax, in which the parameter pairs specify the column reference in the current (source) report on the right and the name of the Dialogue Manager variable in the Drill Down (target) procedure on the left.
If the column reference in the target report is identical to the column reference in the source report, you can use a single column reference, for example, COUNTRY instead of COUNTRY=COUNTRY.
The following StyleSheet declaration places a hyperlink on the PRODUCT field on each DATA line, specifies that the fields to link to the next report are CATEGORY and PRODUCT, specifies the action DOWN, so that clicking a hyperlink brings you to the location in the next report that has the corresponding values of the two link fields, and uses the default appearance for the hyperlinks, which is blue, underlined text. Since the target fields in the detail report have identical names in the summary report, you can use the notation CATEGORY rather than CATEGORY=CATEGORY.
TYPE=DATA, COLUMN=PRODUCT, DRILLTHROUGH=DOWN(CATEGORY PRODUCT), $
The target report is specified in the DRILLMAP attribute of the COMPONENT declaration for the calling report.
DRILLMAP=((L1 targetreport))
where:
Note: The double parentheses around the DRILLMAP values are required.
The following COMPONENT declaration for REPORT1 specifies a DRILLMAP attribute that points to REPORT2:
COMPONENT='REPORT1', TEXT='REPORT1', TOC-LEVEL=2, DRILLMAP=((L1 REPORT2)), POSITION=(0.750 1.083), DIMENSION=(7.000 3.167), METADATA='Z-INDEX: 100; LEFT: 0.75in; OVERFLOW: auto; WIDTH: 7in; POSITION: absolute; TOP: 1.083in; HEIGHT: 3.167in', $
The following COMPONENT declaration for REPORT2 specifies a DRILLMAP attribute that points to REPORT1:
COMPONENT='REPORT2', TEXT='REPORT2', TOC-LEVEL=2, DRILLMAP=((L1 REPORT1)), POSITION=(0.500 0.667), DIMENSION=(7.417 7.000), METADATA='Z-INDEX: 100; LEFT: 0.5in; OVERFLOW: auto; WIDTH: 7.417in; POSITION: absolute; TOP: 0.667in; HEIGHT: 7in', $
Reference: |
The following examples illustrate how to use Drill Through syntax to create a compound report with a summary and detail report and navigate between them.
The following syntax generates a sample summary report:
TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE PCHOLD FORMAT PDF END
The output is:
The following syntax generates a sample detail report:
The first page of the output is:
SET SQUEEZE=ON TABLE FILE GGSALES SUM UNITS BUDUNITS DOLLARS BY CATEGORY NOPRINT BY PRODUCT NOPRINT ON CATEGORY PAGE-BREAK HEADING CENTER "Category: <CATEGORY" " " ON PRODUCT SUBHEAD "**** Product: <PRODUCT" ON PRODUCT SUBFOOT " " "<25 **** Return to Summary ****" ON PRODUCT PAGE-BREAK BY REGION BY CITY ON TABLE PCHOLD FORMAT PDF END
The example illustrates the following:
Although the code can infer a value of PRODUCT for the CATEGORY heading (you can verify this by embedding the field <PRODUCT> in the heading), it is always the value of the first PRODUCT within that CATEGORY. Typically you want a Drill Through hyperlink for each value of PRODUCT within each CATEGORY.
You do not need to place the hyperlink on an embedded item. You can just as effectively place it on a text item. Any item in the subfooting is associated with the same values of CATEGORY and PRODUCT. Similarly, you can place a hyperlink on any field in a DATA line, and the values of the associated link fields will be identical. Conventional Drill Down hyperlinks also work this way.
The summary report:
The summary report is:
TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=DATA, COLUMN=PRODUCT, DRILLTHROUGH=DOWN(CATEGORY PRODUCT), $ ENDSTYLE END
The detail report:
The detail report is:
SET SQUEEZE=ON TABLE FILE GGSALES SUM UNITS BUDUNITS DOLLARS BY CATEGORY NOPRINT BY PRODUCT NOPRINT ON CATEGORY PAGE-BREAK HEADING CENTER "Category: <CATEGORY" " " ON PRODUCT SUBHEAD "**** Product: <PRODUCT" ON PRODUCT SUBFOOT " " "<25 **** Return to Summary ****" ON PRODUCT PAGE-BREAK BY REGION BY CITY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=SUBFOOT, LINE=2, ITEM=1, DRILLTHROUGH=FIRST(CATEGORY PRODUCT), COLOR=RED, $ ENDSTYLE END
The next step is the only step that is different for creating a Compound Layout report or a legacy Compound Report.
Perform this version of Step 4 if you are creating a Compound Layout report.
To create the Compound Layout report:
SET HTMLARCHIVE=ON COMPOUND LAYOUT PCHOLD FORMAT PDF UNITS=IN, $ SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, $ PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5, TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0, $ COMPONENT='REPORT1', TEXT='REPORT1', TOC-LEVEL=2, DRILLMAP=((L1 REPORT2)), POSITION=(0.750 1.083), DIMENSION=(7.000 3.167), METADATA='Z-INDEX: 100; LEFT: 0.75in; OVERFLOW: auto; WIDTH: 7in; POSITION: absolute; TOP: 1.083in; HEIGHT: 3.167in', $ PAGELAYOUT=2, NAME='Page layout 2', text='Page layout 2', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5, TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0, $ COMPONENT='REPORT2', TEXT='REPORT2', TOC-LEVEL=2, DRILLMAP=((L1 REPORT1)), POSITION=(0.500 0.667), DIMENSION=(7.417 7.000), METADATA='Z-INDEX: 100; LEFT: 0.5in; OVERFLOW: auto; WIDTH: 7.417in; POSITION: absolute; TOP: 0.667in; HEIGHT: 7in', $ END
-* Add Report1 code and SET COMPONENT command SET COMPONENT='REPORT1' TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=DATA, COLUMN=PRODUCT, DRILLTHROUGH=DOWN(CATEGORY PRODUCT), $ ENDSTYLE END
-* Add report2 code and SET COMPONENT command SET COMPONENT='REPORT2' SET SQUEEZE=ON TABLE FILE GGSALES SUM UNITS BUDUNITS DOLLARS BY CATEGORY NOPRINT BY PRODUCT NOPRINT ON CATEGORY PAGE-BREAK HEADING CENTER "Category: <CATEGORY" " " ON PRODUCT SUBHEAD "**** Product: <PRODUCT" ON PRODUCT SUBFOOT " " "<25 **** Return to Summary ****" ON PRODUCT PAGE-BREAK BY REGION BY CITY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=SUBFOOT, LINE=2, ITEM=1, DRILLTHROUGH=FIRST(CATEGORY PRODUCT), COLOR=RED, $ ENDSTYLE END COMPOUND END
Perform this version of Step 4 if you are creating a legacy compound report.
The next step is to combine the reports into a single PDF Compound Report. You can:
Drill Through does not support the NOBREAK option, which displays compound reports without intervening page breaks.
This example uses the OPEN and CLOSE options on the PCHOLD FORMAT PDF command:
TABLE FILE GGSALES SUM UNITS DOLLARS BY CATEGORY BY PRODUCT ON TABLE PCHOLD FORMAT PDF OPEN ON TABLE SET STYLE * TYPE=DATA, COLUMN=PRODUCT, DRILLTHROUGH=DOWN(CATEGORY PRODUCT), $ ENDSTYLE END
SET SQUEEZE=ON TABLE FILE GGSALES SUM UNITS BUDUNITS DOLLARS BY CATEGORY NOPRINT BY PRODUCT NOPRINT ON CATEGORY PAGE-BREAK HEADING CENTER "Category: <CATEGORY" " " ON PRODUCT SUBHEAD "**** Product: <PRODUCT" ON PRODUCT SUBFOOT " " "<25 **** Return to Summary ****" ON PRODUCT PAGE-BREAK BY REGION BY CITY ON TABLE PCHOLD FORMAT PDF CLOSE ON TABLE SET STYLE * TYPE=SUBFOOT, LINE=2, ITEM=1, DRILLTHROUGH=FIRST(CATEGORY PRODUCT), COLOR=RED, $ ENDSTYLE END
Run the compound report. The first page of output has the summary report with the hyperlinks to the individual products in blue and underlined:
Click the hyperlink Croissant for the category Food. You jump to that detail information. In the detail report, the hyperlink back to the summary report is in red and underlined:
Click the hyperlink Return to Summary to return to the first page (summary report).
The following guidelines apply:
Reports linked with Drill Through must follow certain rules to ensure that the hyperlinks between them work correctly. The following are key concepts:
Source and target terminology refer to each pair of linked reports. For example, if there are three reports linked with Drill Through, the second report is generally the target report of the first report, and also the source report of the third report.
To process a report as a Drill Through, you must identify the link fields in the source report that relate to the target report: