Creating a PDF Compound Report With Drill Through Links

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.


Top of page

x
Reference: Drill Through and Drill Down Compared

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:


Top of page

x
Reference: Use With Other Features

You can use Drill Through with other WebFOCUS features:


Top of page

x
Procedure: How to Create a Drill Through in a PDF Compound Layout Report

To create a Drill Through in a PDF Compound Layout report:

  1. Create the summary report with a DRILLTHROUGH hyperlink.
  2. Create the detail report with sort values that match the hyperlink field values.
  3. Create the Compound Layout report with page layouts for each component report, and define a DRILLMAP attribute within the calling report to specify the targets of the drill through hyperlinks.

Top of page

x
Procedure: How to Create a Drill Through in a PDF Compound Report

To create a Drill Through in a PDF Compound Report:

  1. Create the summary report.
  2. Create the detail report.
  3. Connect the reports with hyperlinks.
  4. Merge the summary and detail reports into a PDF compound report.

Top of page

x
Syntax: How to Specify Drill Through Hyperlinks
TYPE=type, [element,] [styling_attributes,]
     DRILLTHROUGH={DOWN|FIRST}(link_fields) , $

where:

type
Is one of the following StyleSheet types:
  • DATA
  • HEADING
  • FOOTING
  • SUBHEAD
  • SUBFOOT
  • SUBTOTAL
  • RECAP
element
Is one or more identifying elements allowed in a WebFOCUS StyleSheet and Drill Through report. An element can describe a specific column (for example, COLUMN=PRODUCT) or heading item (for example, LINE=2, OBJECT=field, ITEM=3).
styling_attributes
Optionally specify the appearance of the hyperlink (for example, COLOR=RED, STYLE=BOLD).
DOWN
Links to the next (the following) report.
FIRST
Links to the first Drill Through report in the sequence.
link_fields
Specifies blank-delimited link field pairs with the following format:
T1=S1 T2=S2 T3=S3...
T1, T2, and T3 represent column references in the target (linked) report, and S1, S2, and S3 represent column references in the source (current) report. There may be more than three pairs.

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.



Example: Specifying Drill Through Hyperlinks

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), $

Top of page

x
Syntax: How to Specify Which Compound Layout Reports Will be Related Through Hyperlinks

The target report is specified in the DRILLMAP attribute of the COMPONENT declaration for the calling report.

DRILLMAP=((L1 targetreport))

where:

L1
Is the link identifier.
targetreport
Is the component name of hyperlink destination.

Note: The double parentheses around the DRILLMAP values are required.



Example: Sample Component Declarations With DRILLMAP Attributes

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', $

Top of page

x
Reference: Usage Notes for Drill Through

Top of page

x
Sample Drill Through PDF Compound Reports

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.



Example: Creating the Summary Report (Step 1)

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:



Example: Creating the Detail Report (Step 2)

The following syntax generates a sample detail report:

The first page of the output is:



Example: Connecting the Reports With Hyperlinks (Step 3)

The example illustrates the following:

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, $
END

The next step is the only step that is different for creating a Compound Layout report or a legacy Compound Report.



Example: Creating the Compound Layout Report (Step 4)

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, $
END
COMPOUND END


Example: Merging Summary and Detail Reports Into a PDF Compound Report (Step 4)

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, $
END


Example: Run the Drill Through Report (Step 5)

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).



x
Reference: Guidelines on Links For FIRST

The following guidelines apply:



x
Reference: Rules For Drill Through Hyperlinks

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:


WebFOCUS