Creating Multiple Drill-Down Links

In this section:

How to:

Reference:

You can create multiple drill-down links from a component on a summary report, chosen from any combination of supported actions. For example, you can create links to a detail report or Maintain procedure, a JavaScript function, and a URL. When you click a component in the summary report, a pop-up menu appears listing the drill-down options.

This feature is available for HTML reports and the HTMTABLE format. It applies to data fields in the body of the report, not to headings, subheadings, footings, or subfootings. When the HTMTABLE format is used, special JavaScript coding is required. For more information, see Saving a Drill-Down Report to a Server With HTMTABLE.

Developer Studio has an interface that automatically generates the code. For details, see the topic on creating a multiple drill-down procedure in the Creating Reporting Applications With Developer Studio manual.


Top of page

x
Syntax: How to Create Multiple Drill-Down Links
TYPE=type, [subtype], DRILLMENUITEM='description'|'DrillDown n',
     type_of_link

where:

type
Identifies the report component that you select in the Web browser to execute the link. The TYPE attribute and its value must appear at the beginning of the declaration.
subtype
Are any additional attributes, such as COLUMN, LINE, or ITEM, that are needed to identify the report component that you are formatting. See Identifying a Report Component in a WebFOCUS StyleSheet for information on identifying report components.
description
Is the text that appears on the pop-up menu of drill-down options on the report output. The default value is DrillDown n, where n is a consecutive integer, such as DrillDown 1, DrillDown 2, and so on.
type_of_link
Is the type of link, for example, a link to a detail report or URL. For a summary of valid values, see Summary of Drill-Down Links.

Top of page

x
Reference: Syntax Guidelines

When you create multiple drill-down links, you cannot specify a single drill-down action (for example, FOCEXEC or URL) before the first DRILLMENUITEM.

The menu created by the DRILLMENUITEM keyword is styled using a Cascading Stylesheet file. The file is /ibi/WebFOCUSxx/ibi_apps/ibi_html/javaassist/ibi/html/js/multidrill.css, where xx is the version and major release number of WebFOCUS.

You can make changes to this file to affect the font, size, and color of the DRILLMENUITEM menu. Tip: Make a backup of this file before modifying it.


Top of page

x
Reference: Summary of Drill-Down Links

You can link to:



Example: Creating Multiple Drill-Down Links

In this example, the Developer Studio Report Painter was used to create two procedures: a summary report and a detail report. The summary report uses the DRILLMENUITEM and URL attributes to create a link to a Web site; and the DRILLMENUITEM and FOCEXEC attributes to create a link to the detail report, as shown in boldface in the code.

Notice that any StyleSheet syntax that applies to a report component as a whole precedes the first instance of DRILLMENUITEM. For example, COLOR='BLUE' and STYLE=UNDERLINE apply to the color and underlining of text in the component, not to a particular drill-down action. For information about editing the menu styles, see Syntax Guidelines.

For information on creating a multiple drill-down report using Developer Studio, see the Creating Reporting Applications With Developer Studio manual.

Summary Report:

TABLE FILE GGSALES
SUM
     DOLLARS/D12.2CM
     BUDDOLLARS/D12.2CM
BY ST
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     PAGESIZE='SCREEN',
     LEFTMARGIN=0.000000,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.000000,
     BOTTOMMARGIN=0.000000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     TOPGAP=0.013889,
     BOTTOMGAP=0.027778,$
TYPE=DATA,
     COLUMN=N1,
     COLOR='BLUE',
     STYLE=UNDERLINE,
     DRILLMENUITEM='DrillDown 1',
          URL=http://www.informationbuilders.com,
     DRILLMENUITEM='DrillDown 2',
          FOCEXEC=DETAILREPORT(PARAMETER=N1),$
TYPE=TITLE,
     STYLE=BOLD,$
TYPE=TITLE,
     COLUMN=N1,
     COLOR='BLUE',
     STYLE=BOLD+UNDERLINE,
     DRILLMENUITEM='DrillDown 1',
          URL=http://www.informationbuilders.com,
     DRILLMENUITEM='DrillDown 2',
          FOCEXEC=DETAILREPORT(PARAMETER=N1),$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),$
TYPE=ACROSSVALUE,
     SIZE=9,$
TYPE=ACROSSTITLE,
     STYLE=BOLD,$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,$
ENDSTYLE
END

Detail Report:

TABLE FILE GGSALES
PRINT
     DOLLARS/D12.2CM
     BUDDOLLARS/D12.2CM
BY ST
WHERE (ST EQ '&PARAMETER');
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     PAGESIZE='SCREEN',
     LEFTMARGIN=0.000000,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.000000,
     BOTTOMMARGIN=0.000000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     TOPGAP=0.013889,
     BOTTOMGAP=0.027778,$
TYPE=TITLE,
     STYLE=BOLD,$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),$
TYPE=ACROSSVALUE,
     SIZE=9,$
TYPE=ACROSSTITLE,
     STYLE=BOLD,$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,$
ENDSTYLE
END

Top of page

x
Applying Conditional Styling

You can apply conditional styling to a report component, using a phrase such as WHEN, and use it to select one of a number of different actions, depending on the value of fields in the report.

The WHEN condition must precede the DRILLMENUITEM syntax.

For details on creating conditions, see Linking With Conditions.



Example: Applying Conditional Styling to a Multiple Drill-Down Report

Add the following boldface code to the sample summary report in Creating Multiple Drill-Down Links. Notice that the WHEN condition precedes the code for DRILLMENUITEM, as required.

When you run the summary report, the State field is in red instead of blue whenever budget dollars is greater than dollar sales, and the pop-up menu of drill-down options shows Detail Budget Report instead of DrillDown 1 and DrillDown 2.

.
.
.
TYPE=DATA,
     COLUMN=N1,
     COLOR='BLUE',
     STYLE=UNDERLINE,
     DRILLMENUITEM='DrillDown 1',
          URL=http://www.informationbuilders.com?,
     DRILLMENUITEM='DrillDown 2',
          FOCEXEC=DETAILREPORT(PARAMETER=N1),$
TYPE=DATA, 
     COLUMN=N1,
     COLOR='RED',
     STYLE=UNDERLINE,
     WHEN=BUDDOLLARS GT DOLLARS,
     DRILLMENUITEM='Detail Budget Report',
          FOCEXEC=DETAILREPORT(PARAMETER=N1),$.
.
.

Sample output is:


Top of page

x
Saving a Drill-Down Report to a Server With HTMTABLE

How to:

Instead of displaying report output immediately to your browser, you can save a report to a server and use it to perform additional processing. When you specify the HTMTABLE format to save a drill-down report to a reporting server, JavaScript coding is required. Specific JavaScript code must be included in the output file to identify the server location where the HTMTABLE is saved.



x
Syntax: How to Save a Drill-Down Report to a Server With HTMTABLE

It is necessary to add JavaScript code to the output file created with the -HTMLFORM command when both the DRILLMENUITEM attribute and the HTMTABLE format are used to create a report containing one or more drill-down links.

In the output file, add the appropriate paths to the following attributes.

BASE HREF = http://machine:port/approot/appname/
var focexurl = dir?var&IBIC_server=reportserv&IBIAPP_app=appname&

where:

machine
Is the application server or Web Server.
port
Is the application server or Web Server port number.
approot
Is the hard-coded default value for application root.
appname
Is the application name.
dir
Is the WF Servlet relative directory: /ibi_apps/WFServlet
?
Is a hard-coded delimiter.
var
Use the following hard-coded default variable:

IBIF_webapp=/ibi_apps

&IBIC_server=
Is the hard-coded variable name placed before the reporting server node.
reportserv
Is the reporting server node.
&IBIAPP_app=
Is the hard-coded variable name placed before the application name.
appname
Is the application name.
&
Is a hard-coded delimiter.


Example: Saving a Drill-Down Report to a Server With HTMTABLE
TABLE FILE GGSALES
.
.
.
ON TABLE HOLD FORMAT HTMTABLE AS REPORT1
.
.
.
TYPE=DATA,
     COLUMN=N1,
     COLOR='BLUE',
     STYLE=UNDERLINE,
     DRILLMENUITEM='DrillDown 1',
          URL=http://www.informationbuilders.com?,
     DRILLMENUITEM='DrillDown 2',
          FOCEXEC=DETAILREPORT(PARAMETER=N1),$
.
.
.
END
-HTMLFORM output.HTM

The output.HTM file contains the following JavaScript statements:

<HTML>
<TITLE>FOCUS Report</TITLE>
<BASE HREF="http://localhost:80/approot/IBISAMP/">
<script language='javascript'>
var ibiOptions = new Array("multidrill");
var focexurl = 
"/ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&
IBIAPP_app=IBISAMP&
BIAPP_app=IBISAMP&";
var fochtmlurl = "/ibi_apps/ibi_html";
</script>
<script language='javascript' src='/ibi_apps/ibi_html/javaassist/nls/js'>
</script>
<script 
language='javascript'src='/ibi_apps/ibi_html/javaassist/ibi/html/js/ibigbl.js'>
</script>
<script language='javascript'>
ibigblloadCss(null);
</script>
!IBI.FIL.REPORT1;

WebFOCUS