Displaying images for measure items involves setting up an expression to define the image name/location and setting the Image property to Yes. You can specify a single image for the entire measure item, in which case each cell for measure item will display same image. Or, you can specify an expression that displays a unique image for each cell based on dynamic text in the expression, such as an image that corresponds to products listed in the view. Typically the Value property is set to No and Total property is set to None in these cases.
Here are the basic steps followed by two examples.
1. Right-click the Measure Items folder in view explorer and select Insert Calculated Measure Item.
2. In the Properties window, select Calculated as the Type.
3. In the Expression window, set up an expression to define the name and location of the image and then click OK in that window.
Image file(s) must reside in the Stratum.Viewer application folders. It is recommended that all custom images reside in a subfolder of the Images folder of the Stratum.Viewer application.
Supported file types *.jpg, *.jpeg, *.png, *.bmp, *.gif, *.tif, and *.tiff.
Images will display in the grid according to their original, default size.
4. Set the Value property to No.
Note: If you set Value to Yes then the entire expression will display in the cell next to the image.
5. Set the Image property to Yes.
6. Set the Total property to None (images aren’t needed for total / subtotal rows).
7. {Optional} Enhance the images by defining a hyperlink or pop-up label for the measure item.
The following examples show measure items that display images in a view.
More: Click here for a complete list of all example MDX expressions that exist in this online help for all types of Stratum.Viewer items (calculated measure items, measure item captions, filters, and more).
This view displays an image for each product. The calculated measure item “Product Image” defines the location and file name of the product images.
The Product Image measure item is defined as follows:
Expression – In this example, the product images reside in a subfolder of the Stratum.Viewer Images folder called “Silvon Custom/Product Images”. The first part of the expression determines the location of the product images and the remainder dynamically determines the file name. "Images\Silvon Custom\Product Images\" + [Product].[Product].currentmember.name + ".png" |
|
Value – Set to No. Image – Set to Yes (required to display the image defined by the expression). Total – Set to None. |
The example that follows shows a view containing images with hyperlinks that will take the user to MapQuest and Google using information from each Customer Sold-To attribute relationships. A pop-up label displays additional information for the user.
The Map It! measure item was defined as follows:
Expression – In this example, the image resides in a subfolder of the Stratum.Viewer Images folder called “Silvon Custom”. The full expression defines the relative path to the image: "Images/Silvon Custom/Map.jpg" |
|
Value – Set to No. Image – Set to Yes (required to display the image defined by the expression). Total – Set to None. |
|
Pop-up Label Expression – Here’s the expression for the pop-up label: “Click here to go to MapQuest” Hyperlink – Here’s the expression used for the Map It! hyperlink: "http://www.mapquest.com/maps/map.adp?&city=" + [Customer Sold-To].[Customer Sold-To].CurrentMember.Properties("SldTo City") + "&state=" + [Customer Sold-To].[Customer Sold-To].CurrentMember.Properties("SldTo Province State") + "&zipcode=" + [Customer Sold-To].[Customer Sold-To].CurrentMember.Properties("SldTo Postal Code") + "&country=US&cid=lfmaplink" |
The Google It! measure item was defined as follows:
Expression – In this example, the image resides in a subfolder of the Stratum.Viewer Images folder called “Silvon Custom”. The full expression defines the relative path to the image: "Images/Silvon Custom/google.jpg" |
|
Value – Set to No. Image – Set to Yes (required to display the image defined by the expression). Total – Set to None. |
|
Pop-up Label Expression – Here’s the expression for the pop-up label: “Click here to go to Google” Hyperlink – Here’s the expression used for the Google It! hyperlink: "http://www.google.com/search?hl=en&q=" + [Customer Sold-To].[Customer Sold-To].CurrentMember.Properties("SldTo Long Description") |