Explained: How Cognos 8 locates images for PDF and HTML reports

Why is an image not rendered in a PDF document in multiserver environments when the image is specified with a relative path.

Because there is a fundamental difference concerning the use of pictures between HTML and PDF reports. HTML reports only contain the path to the picture. In PDF, the pictures are embedded directly into the document.

HTML Reports

Images in HTML reports are rendered on the users’ PC by the web browser according to the rules of HTML and URLs. The user, who opens the report with the browser needs to have access to the picture. For images referenced by relative paths, the image will be searched for at the web server.

PDF Reports

Images in PDF reports are rendered by the Cognos 8 server according to the rules described below. The image URL as specified in the image properties is used to locate the image. The format of the URL determines where the Cognos 8 server will look, in an attempt to locate the image. The Cognos 8 process (BIBusTKServerMain.exe) needs to have access to the picture.

In these examples, assume Cognos 8 is installed in D:\Program Files\Cognos\c8. In a distributed Environment for images referenced by relative paths the Application Server will search at first in its local directories - when the image is not found there, the image will be searched for at the web server.

If a relative location has been specified (i.e. the URL starts with …) then start at the webcontent directory in the file system and try to locate location and image.

Example:

The image URL is …\samples\images\cognos_logo.jpg
Cognos 8 looks for D:\Program Files\Cognos\c8\webcontent\samples\images\cognos_logo.jpg

If an absolute location has been specified (i.e. the URL starts with anything other than …), then try to locate the location and image in the bin directory of the file system

Example:

The image URL is samples\images\cognos_logo.jpg
Cognos 8 looks for D:\Program Files\Cognos\c8\bin\samples\images\cognos_logo.jpg


If the URL starts with \ then the root of the install drive will be used as the starting location.

Example:

The image URL is \samples\images\cognos_logo.jpg
Cognos 8 looks for D:\samples\images\cognos_logo.jpg

When a file can not been found, the Cognos 8 process opens an HTTP connection to the specified URL and tries to locate the image that way. Therefore, the correct gateway needs to be defined within Cognos Configuration of the Application Server in order to find the file

www.cogknowhow.com