MicroStrategy ONE

Inserting images in a document

You can insert an image such as a logo into a document. The image must be stored so that it is available to both the Intelligence Server and to the designers of the document. If the designers do not have access to the image, they cannot see the image while creating the document.

You can also use dynamic images in documents.

Using dynamic images

Dynamic images allow different images to be displayed depending on the data in the dataset. You can use attributes and metrics to determine the file name of the image.

For example, a document is paged by Region. For each Region, a map for that particular region must be displayed, as in the two pages of the following sample document.

To do this, save the graphic files as the names of the Regions (for example, Northeast.jpg and Mid-Atlantic.jpg). Insert an image in the Region Header. Use the attribute name, within braces, as the name of the image file, for example, \\my_computer\shared\{Region}.jpg. Specify the directory path and follow the guidelines above to ensure that the image is available to users and designers.

When the PDF is displayed, {Region} in the filename is replaced with the attribute element used in the page-by field. For example, on the Northeast page, the image displayed is Northeast.jpg.

In the same way, you can use a metric to return the name of the image file. For example, a document must display an icon for the daily revenue trend. For revenue growth, the icon is an arrow pointing up; for revenue decline the arrow points down; and for stable revenue the arrow is replaced by a bar.

To do this, create a metric that returns a 1 for growth, 2 for no change, and 3 for decline. Create and name the images accordingly. In the document, point the image to {MetricName}.jpg in the correct directory. When the PDF is displayed, the image path is resolved and the correct file is displayed on each line.

Format the metric as Fixed Type, zero decimal places, and no thousands separator. This ensures that the metric value is returned as 1, 2, or 3, not as $1.00, for example.

If you want to create multiple dynamic images that use the same attribute elements or metric values, ensure that the correct dynamic image is used by giving each dynamic image a different name that contains the attribute element or metric value. For example, one file may be named Map_Northeast.jpg while the other is named Graph_Northeast.jpg. Other than the name of the attribute element, the names of each dynamic image's files must be the same, for example, Map_Northeast.jpg, Map_Mid-Atlantic.jpg.

When adding multiple dynamic images, embed the attribute or metric's name, in braces, in the name of the image file. For example, \\my_computer\shared\Map_{Region}.jpg, or \\my_computer\shared\raph_{Region}.jpg.

When the dashboard is displayed, {Region} in the filename is replaced with the appropriate attribute element. If the attribute element is Northeast, the images named Map_Northeast.jpg and Graph_Northeast.jpg are used.

Ensuring access to images

To ensure that the image is available as needed, MicroStrategy recommends that you save the image file on a web server that all your MicroStrategy products, including Intelligence Server, can use and access. When you add the image to a document, use an HTTP reference to that accessible Web server machine, such as http://microstrategy/Test/myimage.jpg.

The advantages of using HTTP paths are:

  • You can view the image when the document is in Flash mode. Images that use a non-HTTP-based path are not displayed in Flash mode.

  • The image does not need to be duplicated onto each machine, since MicroStrategy Developer, Intelligence Server, and the web server access the images from the same central web server.

If you cannot store and access the images on a web server, you can store images on alternative network locations and use either a full or partial path.

The advantage of using a full path is:

  • The image does not need to be duplicated onto each machine, since MicroStrategy Developer, Intelligence Server, and the web server access the images from the same shared file location.

The advantages of using partial or relative paths are:

  • The path of the image is not part of the document definition. If the path changes, you do not have to manually change the image path in the document.

  • All machines do not need to be able to access the same machine, because the image is copied onto the different machines.

  • You can display a different image in the document for each machine used to access the image. For example, you have a high resolution version of an image you want to display in Mobile and a lower resolution version for Web. You can save the high resolution version in the Mobile server and the lower resolution version in the Web server with the same name, then use a relative path so that the appropriate image is used.

The type of path you can use depends on where you save the image and whether MicroStrategy and your users can access the image. For example, if the image is on a Web server machine, you can specify the URL (an HTTP reference) for the file as long as the Intelligence Server and users who design the documents can access that location.

Based on the type of path you want to use, save the image in the appropriate location listed in the table below. Once the location is established and the image file that you want to insert is available in that location, you can insert the image into a document:

Path type

Where to save the image

HTTP

For example, http://microstrategy/Test/myimage.jpg

An accessible web server machine that all your MicroStrategy products, including Intelligence Server, can use and access.

Avoid using spaces in the URL. On UNIX machines, images with spaces in their URLs cannot display in PDFs. You can remove the space from the image name or replace the space with %20.

In most instances, you can find the path and file name of images to use by viewing the source of a Web page.

Full path

For example, \\my_computer\shared\myimage.jpg

A shared network drive. All users, the Intelligence Server, and the web server must be able to access the drive. If you are adding the image to the document in MicroStrategy Developer, then MicroStrategy Developer must also be able to access the drive.

Partial path

For example, Images\myimage.jpg

The folder where the product you want to use to access the image is installed. Save the image in the appropriate folder below or, if you want all MicroStrategy products to be able to access the image, save the image in all of the following folders:

Developer (for a document viewed in MicroStrategy Developer)

Intelligence Server (for a document exported to PDF from MicroStrategy Web)

Web ASPx\asp (for documents in MicroStrategy Web) or \jsp (for documents in MicroStrategy Web Universal)

The Web directory is the physical location where the Web product is installed (for MicroStrategy Web) or where it is deployed (for MicroStrategy Web Universal).

Mobile ASPx (for a documented viewed in MicroStrategy Mobile)

Inserting an image

To insert an image, follow the steps below.

Prerequisites

  • The image file must be saved in the correct image type: bmp, jpg, jpeg, or gif.

  • The image file must be stored so that it is available to both the Intelligence Server and to the designers of the document.

  • For dynamic images, you must have created the image files with the appropriate names. To use an attribute, save the image files so that their names are the attribute's elements; to use a metric, save the files so that their names are the values returned by the metric.

    If you have multiple dynamic images that use the same attribute elements or metric values, give each dynamic image a different name that contains the attribute element or metric value.

To insert an image in a document

  1. In MicroStrategy Web, open the document in Design or Editable Mode.

  2. From the Insert menu, select Image.

  3. Click and drag in the location where you want to insert the image. The Properties and Formatting dialog box opens.

  4. In the Source field, type in the path for the image file. In general, you can type the file path in a C:/My_Images/logo.gif format, with the following important exceptions:

    • If the document will be opened in Flash Mode, use an HTTP-based image path. Do not use a network image path (for example, \\corporate-administrator\Shared\image.jpg) or a local image path (for example, C:\My_Images\image.jpg). Images that use a non HTTP-based path are not displayed in Flash Mode.

    • If the document will be exported to Excel, use an absolute image path. Do not use a relative image path. Images that use a relative image path are not displayed in Excel.

    • If you are inserting a dynamic image, type the folder path to the image files, then the name of one of the dynamic image's files. Replace the attribute element or metric value with the attribute or metric's name in braces { }. Use brackets [ ] if the attribute or metric name contains spaces.

      For example: the following image sources point to the Revenue Trend metric: \\my_computer\shared\{[Revenue Trend]}.jpg and \\my_computer\shared\Plot_{[Revenue Trend]}.jpg.

  5. To have the size of the image adjust automatically, right-click the image and select Size and then select To Grid.

  6. If you want users to be able to click the image and go to a web page, you can define the image as a hyperlink. From the Properties and Formatting dialog box, click General, select the Is Hyperlink check box, and type the URL in the Hyperlink field.

    For information about changing image formatting, such as borders, seeFormatting images.