Class ReportGridCellRowTitleImpl

  • All Implemented Interfaces:
    ReportGridCellRowTitle, ReportGridCellTitle, ReportGridDisplayCell, java.lang.Cloneable
    Direct Known Subclasses:
    ReportGridExcelCellRowTitleImpl

    public class ReportGridCellRowTitleImpl
    extends AbstractReportGridCellTitle
    implements ReportGridCellRowTitle

    The ReportGridCellRowTitleImpl is used to generate the HTML of a cell of that is a title of the row axis.

    This class can handle two different types of SDK objects:

    1. WebTitle: used in view mode, this is the SDK object that represents a title of the row axis.
    2. WebSubTitle: used in view mode when attribute forms are being displayed, for each attribute form there will be a corresonding WebSubTitle.
    3. WebTemplateUnit: used in design mode, this is the SDK object used in a template for the row axis.

    The ReportGridCellRowTitleImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

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

    The following is an example of a class that extends the AbstractReportGridDisplayCell.generateText(com.microstrategy.web.beans.MarkupOutput) method of this class based on the title's template unit type:
     public class CustomColTitle extends ReportGridCellRowTitleImpl {
    
         public void generateText(MarkupOutput mo) {
             WebTitle title = getWebTitle();
    
             if (title.getWebTemplateUnit() != null) {
                 WebTemplateUnit unit = title.getWebTemplateUnit();
    
                 if (unit.getUnitType() == EnumDSSXMLTemplateUnitType.DssXmlTemplateMetrics) {
                     mo.append(getDescriptor(1158));        // Descriptor: Metrics
                 } else if (unit.getUnitType() == EnumDSSXMLTemplateUnitType.DssXmlTemplateDimension && title.getGridSubTitles().size() > 0) {
                     mo.append(HTMLHelper.encode(title.getGridSubTitles().get(0).getName()));
                 } else {
                     mo.append(HTMLHelper.encode(unit.getAlias()));
                 }
             } else if (title.getTarget() != null) {
                 mo.append(HTMLHelper.encode(title.getTarget().getName()));
             } else {
                 super.generateText(mo);
             }
         }
     }
     
    Since:
    MicroStrategy Web 7.5.1
    See Also:
    ReportGridDisplayCell, ReportGridTransformImpl