The transform created by the following code example changes the default font and background colors for row and column headers on all scorecards on a server. This transform resets properties in the GridViewData class.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.PerformancePoint.Scorecards;
using Microsoft.PerformancePoint.Scorecards.Extensions;
using Microsoft.PerformancePoint.Scorecards.GridViewTransforms;
namespace Extensions.Dashboard
{
public class FormattingTransform : IGridViewTransform
{
// Set the "PreRender" transform type to run the transform
// immediately before the scorecard is rendered.
public GridViewTransformType GetTransformType()
{
return GridViewTransformType.PreRender;
}
// Return the string idenfitier of your transform.
public string GetId()
{
return "FormattingTransform";
}
// Run the transform. This transform changes the font and background
// color for all scorecards.
public void Execute(GridViewData viewData, PropertyBag parameters, IGlobalCache cache)
{
// Change the default font.
viewData.DefaultCellFormatInfo.FontInfo.FamilyName = "Cambria";
// Change the default header background color by creating new GridColor
// objects and then assigning them as the value for the BackColor property.
GridColor columnHeaderBackColor = new GridColor(0xaa, 0xee, 0xff, 0xaa);
GridColor rowHeaderBackColor = new GridColor(0xff, 0xee, 0xff, 0xcc);
viewData.DefaultColumnHeaderFormatInfo.BackColor = columnHeaderBackColor;
viewData.DefaultRowHeaderFormatInfo.BackColor = rowHeaderBackColor;
}
}
}