SCENARIO
When defining thresholds (using either Strategy Web or Developer) it is possible to display an image based on a condition instead of the metric value. By default, the metric value is no longer visible, and only the threshold image displays, as shown in the following screenshot:

This is the default behavior when working with thresholds in Strategy. However, it may be desirable to still see the metric value as well as the image.
There are many ways this can be accomplished. For example, it can be accomplished by creating a derived metric which is identical to the existing metric, and then apply the thresholding to this derived metric, leaving the original metric values intact.
Another way to accomplish this is by performing a customization in Strategy Web where the metric value can appear as a tooltip when the mouse is hovering over the threshold image.
To accomplish this customization, these steps are required:
1. Create a custom addon to include a result flag that will bring back the raw data of the report (in addition to the formatted data).
2. Create a custom grid class transform that extends the ReportGridCellMetricValueImpl class and override the generateTooltipContent() method to generate the custom tooltip content.
3. Configure this grid customization to be available for all reports or for specific reports.
Once the customization is complete, the metric value will appear as a tooltip when hovering over the cell as shown below:

STEPS
To implement this customization, perform the following steps in detail:
Part 1. Create a custom addon to include a result flag that will bring back the raw data of the report (in addition to the formatted data).
1. Using the Web Customization Editor (WCE), create a new plugin named 'ShowValueAndThreshold'.
2. Switch to the Application Settings tab (Strategy View should be open) and expand 'Pages'
3. Right-click on the page named 'report' and click 'Create New Addon'. The name of the new Addon should be 'CustomReportFlags' and is a 'preCollectData' addon.
For step-by-step instructions for creating a new addon using the Web Customization Editor (WCE), click here.
4. Replace the auto-generated code with the following Addon code:
package customclasses.addons; //Specify correct package name here
import com.Strategy.web.app.addons.AbstractAppAddOn;
import com.Strategy.web.app.beans.PageComponent;
import com.Strategy.web.beans.ReportBean;
import com.Strategy.webapi.EnumDSSXMLResultFlags;
public class CustomReportFlags extends AbstractAppAddOn {
public String getAddOnDescription() {
return "Including XML Raw Data with XML result so we can get the metric value that the threshold is replacing";
}
public void preCollectData(PageComponent page) {
System.out.println("Calling CustomReportFlags Addon");
ReportBean rb = (ReportBean) page.getChildByClass(ReportBean.class);
if (rb == null) return;
/*TODO: Add additional custom logic here to apply this customization
for only specific reports (or to exclude very large reports)
as this result flag will increase the size of the XML sent to Web*/
rb.setResultFlags(rb.getResultFlags() | EnumDSSXMLResultFlags.DssXmlResultRawData);
return;
}Source folder: Source Folder designated in the WCE Package: $CUSTOMPACKAGENAME$ Name: ThresholdAndValueMetricValue Transform Description: Custom Transform to display metric value as tooltip when there is a threshold image present Superclass: com.Strategy.web.app.transforms.ReportGridCellMetricValueImpl Open new style wizard: Unchecked
package customclasses.transforms; //Specify correct package name here
import java.text.NumberFormat;
import com.Strategy.web.app.transforms.ReportGridCellMetricValueImpl;
import com.Strategy.web.objects.WebRowValue;
public class ThresholdAndValueMetricValue extends ReportGridCellMetricValueImpl {
public String getDescription() {
return "Custom Transform to display metric value as tooltip when there is a threshold image present";
}
@Override
protected String generateTooltipContent() {
/*TODO: Add additional custom logic here to apply this customization
for only specific reports. If the report being rendered does not match the
the designated reports, then call super.generateTooltipContent() */
//get the current tooltip content (value could be null)
String strTooltip = super.generateTooltipContent();
//Get the cell value currently being rendered
WebRowValue value = getWebRowValue();
//Check if the value is an Web URL which in this case is pointing to the threshold image
if (value.getValue().startsWith("http")) {
//Convert the value to double
double dbl = Double.parseDouble(value.getRawValue());
//the raw value contains no formatting, so we are going to apply the currency number formatter to the value
NumberFormat nf = NumberFormat.getCurrencyInstance();
strTooltip = nf.format(dbl);
}
return strTooltip;
}
}customclasses.transforms.ThresholdAndValueMetricValue
PREREQUISITES:
For the sample to work, the Strategy Web JAR files must be accessible by the Java Runtime
Environment. The Strategy Web JAR files can be found under:
Note:
More elaborate programs will require additional library files and are out of the scope of this document.
ADDITIONAL INFORMATION:
The Strategy SDK allows you to customize the standard Strategy Web interface, and extend and integrate the Strategy business intelligence functionality into other applications. However, before changing the way Strategy Web products look or behave, it is helpful to understand how the application is built. For more information regarding the Strategy Web architecture or the process of customizing Strategy Web, please refer to Strategy Developer Zone (https://resource.microstrategy.com/msdz/).
To access the Strategy Developer Zone, you must have access to the Strategy Knowledge Base, you must have purchased the Strategy SDK, and you must be current on your Strategy maintenance agreement. If you are a US-based business and believe that you satisfy all three of these conditions but you do not have access to the Strategy Developer Zone, please contact Strategy Technical Support at support@microstrategy.com or at (703) 848-8700. If you are an international business, please contact Strategy Technical Support at the appropriate email address or phone number found at http://www.microstrategy.com/Support/ContactUs.asp.
CUSTOMIZATION WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.