Class ReportGridCellColTitleImpl

  • All Implemented Interfaces:
    ReportGridCellColTitle, ReportGridCellTitle, ReportGridDisplayCell, java.lang.Cloneable
    Direct Known Subclasses:
    ReportGridExcelCellColTitleImpl

    public class ReportGridCellColTitleImpl
    extends AbstractReportGridCellTitle
    implements ReportGridCellColTitle

    The ReportGridCellColTitle is used to generate the HTML of a cell of that is a title of the column 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 column 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 column axis.

    The ReportGridCellColTitleImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

    Users who intend to programatically modify the HTML generated for a column 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(MarkupOutput) method of this class based on the title's template unit type:
     public class CustomColTitle extends ReportGridCellColTitleImpl {
    
         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