MicroStrategy ONE

Using dynamic images in documents

You can add dynamic images to a document, as well as static images. Dynamic images allow different image files to be displayed depending on the data in the dataset. Attribute elements or metric results can determine the file name to display.

As with any image in a document, the graphic files must be available to both the Intelligence Server and all users who design the document, so they can view the images while designing the document. To ensure access, follow the guidelines in Adding images to documents.

Using an attribute

For example, a document is paged by Region. For each Region, a map for that particular region must be displayed. Dynamic images allow you to display a different graphic file for each region.

To use the dynamic images, save the various graphic files with the names of the attribute elements, such as Northeast.jpg, Mid-Atlantic.jpg, and so on. Insert an image into the document, using the attribute name, within braces, as the name of the image file. In this case, the full path and name is \\my_computer\shared\{Region}.jpg.

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

Using a metric

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.

In the Metric Editor, 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.

For more examples and details, see the Document Creation Help.

Prerequisites

Before you can add an image to a document:

  • The image file must be saved in the correct image type.

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

See Adding images to documents for details of both these requirements.

To insert a dynamic image

  1. Open a document in the Document Editor. How?

  2. Expand the document section where you want the image by clicking the plus sign next to the section name.

  3. Select Image from the Insert menu, or click the Image icon in the toolbar. When you move the cursor to the Layout area, the pointer becomes crosshairs.

  4. Click in the desired section of the Layout area. If you click and drag in the section, you can size the image. The Image Source dialog box opens.

  5. Type the directory path to the image files, then the attribute or metric name in braces { }, followed by the file extension. For example, the following image source points to the Revenue Trend metric described in the example.

    \\my_computer\shared\{[Revenue Trend]}.jpg

    If the attribute or metric name contains a space, enclose the name in square brackets [ ].

  6. Click OK. The image control appears in the document. No image is displayed, since multiple files are possible.

  7. You can change the formatting, such as borders, of the image. How?

Related Topics