Class ReportGridCellColHeaderImpl

  • All Implemented Interfaces:
    ReportGridCellColHeader, ReportGridCellHeader, ReportGridDisplayCell, java.lang.Cloneable
    Direct Known Subclasses:
    IPhoneReportGridCellColHeaderImpl, ReportGridExcelCellColHeaderImpl

    public class ReportGridCellColHeaderImpl
    extends AbstractReportGridCellHeader
    implements ReportGridCellColHeader

    The ReportGridCellColHeaderImpl is used to generate the HTML of a cell of that is a value of the column axis.

    This class can handle two different types of SDK objects:
    1. WebHeader: used in view mode, this is the SDK object that represents a value of the column axis.
    2. WebTemplateMetric: used in design mode when the metrics are located in the column axis, each metric is represented as a column header.

    The ReportGridCellColHeaderImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

    Users who intend to programatically modify the HTML generated for a column header should extend this class. Using this technique developers could define their own rules of the text to display based on the WebHeader content.

    The following is an example of a class that extends the AbstractReportGridCellHeader.generateText(com.microstrategy.web.beans.MarkupOutput) method of this class based on the header's semantics:
     public class CustomColHeader extends ReportGridCellColHeaderImpl {
    
         public void generateText(MarkupOutput mo) {
             WebHeader header = getWebHeader();
    
             if (header != null) {
                 switch (header.getSemantics()) {
                 case EnumDSSXMLBaseFormType.DssXmlBaseFormPicture:
                     mo.append("<IMG SRC=\"");
                     mo.append(getText());
                     mo.append("\" ALT=\"\" BORDER=0 />");
                     break;
    
                 case EnumDSSXMLBaseFormType.DssXmlBaseFormUrl:
                 case EnumDSSXMLBaseFormType.DssXmlBaseFormEmail:
                     mo.append("<A HREF=\"");
                     if (header.getSemantics() == EnumDSSXMLBaseFormType.DssXmlBaseFormEmail) mo.append("mailto:");
                     mo.append(getText());
                     mo.append("\">");
                     mo.append(getText());
                     mo.append("</A>");
                     break;
    
                 case EnumDSSXMLBaseFormType.DssXmlBaseFormHTMLTag:
                     mo.append(HTMLHelper.decode(getText()));
                     break;
    
                 default:
                     super.generateText(mo);
                     break;
                 }
             } else {
                 super.generateText(mo);
             }
         }
     }
     
    Since:
    MicroStrategy Web 7.5.1
    See Also:
    ReportGridDisplayCell, ReportGridTransformImpl