Linking to a URL

In this section:

How to:

Reference:

You can define a link from any report component to any URL including webpages, websites, Servlet programs, or non-World Wide Web resources, such as an email application. After you have defined a link, you can select the report component to access the URL.

The links you create can be dynamic. With a dynamic link, your selection passes the value of the selected report component to the URL. The resource uses the passed value to dynamically determine the results that are returned. You can pass one or more parameters. For details, see Creating Parameters.

Syntax: How to Link to a URL

TYPE=type, [subtype], URL=url[(parameters ...)], [TARGET=frame,] [ALT =  'description',] $

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. For information on identifying report components, see Identifying a Report Component in a WebFOCUS StyleSheet.
url
Identifies any valid URL, including a URL that specifies a WebFOCUS Servlet program, or the name of a report column enclosed in parentheses whose value is a valid URL to which the link will jump.

Note:

  • The maximum length of a URL=url argument, including any associated variable=object parameters, is limited by the maximum number of characters allowed by the browser. For information about this limit for your browser, search on your browser vendor's support site. The URL argument can span more than one line, as described in Creating and Managing a WebFOCUS StyleSheet.

    Note that the length of the URL is limited by the maximum number of characters allowed by the browser. For information about this limit for your browser, search on your browser vendor’s support site.

  • If the URL refers to a WebFOCUS Servlet program that takes parameters, the URL must end with a question mark (?).
parameters
Values that are passed to the URL. For details, see Creating Parameters.
frame
Identifies the target frame in the webpage in which the output from the drill-down link is displayed. For details, see Specifying a Target Frame.
description
Is a textual description of the link supported in an HTML report for compliance with Section 508 accessibility. Enclose the description in single quotation marks.

The description also displays as a pop-up description when your mouse or cursor hovers over the link in the report output.

Example: Linking to a URL

The following example illustrates how to link to a URL from a report. The heading Click here to access the IB homepage is linked to the URL www.ibi.com. The relevant StyleSheet declarations are highlighted in the request.

Note that webserver indicates the name of the webserver that runs WebFOCUS.

TABLE FILE GGSALES
ON TABLE SET PAGE-NUM OFF
SUM UNITS AND DOLLARS
BY CATEGORY BY REGION
HEADING
"Regional Sales Report"
"Click here to access the IB homepage."
" "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $ 
TYPE=HEADING, LINE=2, OBJECT=TEXT, ITEM=1,
   URL=http://www.ibi.com, $ 
ENDSTYLE
END

The output is:

When you click the link the site displays in your browser.

Example: Linking to a URL to Run a Drilldown WebFOCUS Server Procedure

The following request is initiated from a browser session and runs a drill down report stored on the WebFOCUS Reporting Server.

This procedure is run from a browser, so the drilldown in the example is specified as a relative URL (it does not have protocol, host, or port) because it will be submitted using the protocol, host, and port of the current browser session.

Note: This technique is useful in a Managed Reporting procedure for creating a drill down to a WebFOCUS Server procedure. The FOCEXEC= technique for running a drill down procedure does not work because Managed Reporting always looks for the procedure in the Managed Reporting repository.

The main procedure is:

TABLE FILE GGSALES
ON TABLE SET PAGE-NUM OFF
SUM UNITS AND DOLLARS
BY CATEGORY BY REGION
HEADING
"Regional Sales Report"
" "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, COLUMN=REGION,
URL=/ibi_apps/WFServlet?(IBIF_ex='ggdrill' AREA=REGION IBIC_server='EDASERVE' IBI_APPS='IBISAMP'),$
ENDSTYLE
END

The drilldown report, which must be in application ibisamp, is:

-DEFAULTS &REGION='$*';
TABLE FILE GGSALES
ON TABLE SET PAGE-NUM OFF
SUM UNITS AND DOLLARS
BY PRODUCT
WHERE REGION = '&AREA'
HEADING
"Sales Report for Region &AREA"
" "
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
ENDSTYLE
END

The output of the main report is:

If you click the region Northeast, the output is:

Reference: Usage Notes for Linking to a URL

  • Special characters that should be interpreted as text within a URL must be encoded. For example, if you need to include a slash character (/) as text in the URL string, you must use its encoded value, '%2F'. For example, to drill down on the title of a report to a URL, such as passing 'A' with value '2009/03' to test.asp, the StyleSheet command should be:
    TYPE=TITLE, URL=/test.asp?(A='2009%2F03'), $

Defining a Hyperlink Color

How to:

You can use the HYPERLINK-COLOR attribute to designate a color for a hyperlink within a report. This applies to all hyperlinks generated in the report. You can define a single color for the entire report or different colors for each individual element.

Syntax: How to Define a Hyperlink Color

TYPE = type, HYPERLINK-COLOR = color

where:

type

Is the report component you wish to affect. You can apply this keyword to the entire report using TYPE=REPORT. The attribute can also individually be set for any other element of the report. For details, see Identifying a Report Component in a WebFOCUS StyleSheet.

color

Can use any style sheet supported color value designation. For available color values that can be utilized with the syntax, see Color Values in a Report.

Example: Defining a Hyperlink Color

The following PDF request illustrates how to define hyperlink colors for the entire report, as well as individual elements.

  • The default font color for the entire report is grey and the default hyperlink color for the entire report is slate blue.
  • For the Dollar Sales column (DOLLARS), the font color is green and the hyperlink color is purple.
  • For both the Dollar Sales column (DOLLARS) and the Unit Sales column (UNITS), conditional styling has been applied using the same condition (REGION GE 'O').
  • For the Unit Sales column (UNITS), when the conditional styling is met, the hyperlink color is inherited from the default hyperlink color for the report (slate blue).
  • For the Dollar Sales column (DOLLARS), when the conditional styling is met, the hyperlink color is purple.
TABLE FILE GGSALES
SUM DOLLARS/D12CM UNITS/D12C
BY REGION
BY CATEGORY
HEADING
"Hyperlinks of Many Colors"
""
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON, FONT=ARIAL, GRID=OFF, COLOR=GREY, 
  HYPERLINK-COLOR='SLATE BLUE',$
TYPE=DATA, COLUMN=UNITS, WHEN=REGION GE 'O', URL='http://www.ibi.com',$
TYPE=DATA, COLUMN=DOLLARS, COLOR=GREEN, HYPERLINK-COLOR='PURPLE',$
TYPE=DATA, COLUMN=DOLLARS, WHEN=REGION GE 'O', URL='http://www.ibi.com',$
ENDSTYLE
END

The output is:

Reference: Usage Notes for HYPERLINK-COLOR

  • By default, drill-down links are presented in hyperlink blue and underlined.
  • In HTML and DHTML reports, any designated report font color overrides the drill-down default font color.
  • For standard reports, set the HYPERLINK-COLOR attribute using the TYPE=REPORT declaration of the style sheet.
  • For compound reports, set the HYPERLINK-COLOR attribute using the TYPE=REPORT declaration of the style sheet of the first component report (excluding anything on the Page Master).
  • For PPTX, the hyperlink color is stored as part of the PPTX Slide Master theme. Only one HYPERLINK-COLOR attribute can be defined for each request (report/compound report).