Forum Stats

  • 3,750,349 Users
  • 2,250,160 Discussions
  • 7,866,946 Comments

Discussions

<dvt:pivotTable> Highlight columns with background color

user1163882
user1163882 Member Posts: 67 Blue Ribbon

HI All,

Jdeveloper - 12.2.1.3

I have a requirement to highlight the whole column if it's the weekend.

Thanks,

Nikhil

Tagged:

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,457 Red Diamond

    The mark in the image is on a row. You are asking about a column. This doesn't match.

    We would need more information about how the pivot table is built. You can use EL (which calculated if a cell is a weekend) and switch the color.


    Timo


  • user1163882
    user1163882 Member Posts: 67 Blue Ribbon

    @Timo Hahn :The mark in the image is on a row. -Sorry for the confusion, that's some other requirement

    you can see the column (weekend, holiday) highlighted in orange color - that's the requirement.

    Code for the pivot table:


     <dvt:pivotTable id="pt1" value="#{bindings.MeldungPersonROVO.pivotTableModel}" var="cellData"

                      varStatus="cellStatus" splitMode="enabled" pivotEnabled="false"

                      preferredColumnHeaderHeight="100" preferredRowHeaderWidth="100"

                      sizing="#{bindings.MeldungPersonROVO.estimatedRowCount>0?'auto':'fixed'}"

                      summary="Meldung Person" columnFetchSize="10" contentDelivery="immediate"

                      sortMode="none" inlineStyle="margin-top: 5px;margin-bottom: 5px;"

                      layerLabelMode="rendered" >

                <dvt:headerCell>

                  <af:switcher facetName="#{cellData.layerName}" defaultFacet="Default" id="s2">

                    <f:facet name="DataLayer">

                      <af:outputText value="#{cellData.label}"  id="ot1"/>

                    </f:facet>

                    <f:facet name="Tag">

                      <af:outputText value="#{cellData.dataValue}" id="ot2"

                      />

                    </f:facet>

                    <f:facet name="Mitarbeiter">

                      <af:outputText value="#{cellData.dataValue}" id="ot3"/>

                    </f:facet>

                    <f:facet name="Default">

                      <af:outputText value="#{cellData.dataValue}" id="ot4"/>

                    </f:facet>

                  </af:switcher>

                </dvt:headerCell>

                <dvt:dataCell id="dc1">

                  <af:switcher facetName="#{cellStatus.members.DataLayer.value}" defaultFacet="Default"

                         id="s4">

                    <f:facet name="GrundAbbr">                 

                      <af:outputText value="#{cellData.dataValue}"  id="o86" 

                              rendered="#{not empty cellData.dataValue}"/>

                    </f:facet>

                    <f:facet name="Default">

                            <af:outputText value="" id="ot10" shortDesc="#{cellData.dataValue}"

                              rendered="#{not empty cellData.dataValue}"/>

                    </f:facet>

                  </af:switcher>

                </dvt:dataCell>

              </dvt:pivotTable>

              

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,457 Red Diamond

    You can try to use headerFormat and dataFormat properties of the pivot component. Point them to a method in a bean where you find out if the cell is a weekend and set the right style.

    Here are two blogs you can look at to see how it works:

    Timo


    user1163882
  • user1163882
    user1163882 Member Posts: 67 Blue Ribbon

    @Timo Hahn After adding headerFormat and dataFormat I was able to highlight weekends(header data) as below.

    But my requirement is to highlight every cell below and above "SA" and "SO "as posted in the earlier image.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,457 Red Diamond

    You need to get creative :)

    in the dataFormat method you have to find out if the cell belongs to a header that is a weekend.


    Timo


    user1163882