Class ReportGridCellRowHeaderImpl

  • All Implemented Interfaces:
    ReportGridCellHeader, ReportGridCellRowHeader, ReportGridDisplayCell, java.lang.Cloneable
    Direct Known Subclasses:
    IPhoneReportGridCellRowHeaderImpl, ReportGridExcelCellRowHeaderImpl

    public class ReportGridCellRowHeaderImpl
    extends AbstractReportGridCellHeader
    implements ReportGridCellRowHeader

    The ReportGridCellRowHeaderImpl is used to generate the HTML of a cell of that is a value of the row 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 row axis.
    2. WebTemplateMetric: used in design mode when the metrics are located in the column axis, each metric is represented as a row header.

    The ReportGridCellRowHeaderImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

    Users who intend to programatically modify the HTML generated for a row 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 ReportGridCellRowHeaderImpl {
    
         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
    • Constructor Detail

      • ReportGridCellRowHeaderImpl

        public ReportGridCellRowHeaderImpl()
        Constructor used for creating a generic display cell. For example, the cssPrefix is needed for the empty cells in design mode.