0 Replies Latest reply: Mar 1, 2011 12:03 AM by 843518 RSS

    Expand Collapse Feature in OBIEE 10.1.3.4 version using Java script Issue

    843518
      Hi All,

      Tried to implement this script in OBIEE 10.1.3.4, but throughs error. Can any one help me in this regards


      Steps followed

      1. Create an answers report pulling Top Relations, Sub Relationship and Customer from the dimension and sales amount from the Sales fact
      2. For Sub Relationship and Customer give the left padding as 25.
      3. Create a pivot table view make Top Relationship, Sub Relationship hidden and select show the total before and select labels only (no totals) in the pivot table.
      4.Add the image files in and the following code for Top Relationship, Sub Relationship columns select the data format to as HTML image and change it to custom text and add the following.
      @[html]<img onclick="ExpandCollapse(this)" src="res/s_oracle10/images/PropertyGroup_minus.gif">@H
      5. Add a narrative view and add the following java script.

      // Java Script

      function ExpandCollapse( el )
      {
           // Grab the ROW that was clicked and the TABLE that contains it

           var tr = el.parentElement.parentElement;
           var tbl = tr.parentElement.parentElement;

           // Set the alternating display values for hiding/showing the row

           var sDisplay = ( el.src.indexOf( "minus" ) == -1 ) ? "" : "none";
           var sDisplayReverse = ( el.src.indexOf( "minus" ) == -1 ) ? "none" : "";

           //Switch the icon for the clicked row

           el.src = "C:/Manohar/HTMLTest/PropertyGroup_" + ( el.src.indexOf( "minus" ) == -1 ? "minus" : "plus" ) + ".gif";

           // Starting with the row below the clicked row, start checking each row

           for ( var i = tr.rowIndex + 1; i < tbl.rows.length; i++ )
           {
                // Set the Current row indicator nad the left padding value
                var trCurrent = tbl.rows( i );
                var trCurrentLeft = trCurrent.cells(0).style.paddingLeft;

                // if the current row contains an IMG in it, it's a clickable level and we either have to stop processing,
                // or reset the icons to a + as it's being collapsed
                if ( trCurrent.cells( 0 ).firstChild && trCurrent.cells( 0 ).getElementsByTagName( "IMG" ).length )
                {
                
                     // If the current row is at the same level or above in the tree, then stop processing,
                     // else reset all the signs below it, essentially collapsing all branches underneath the one that is beig collapsed.

                     if ( stripTrailing(trCurrentLeft , UOM_SIZE) <= stripTrailing(tr.cells(0).style.paddingLeft , UOM_SIZE) )
                     { break; }
                     else
                     {
                          if (el.src.indexOf( "minus" ) == -1 )
                          {
                               trCurrent.cells(0).getElementsByTagName("IMG").item(0).src = "C:/Manohar/HTMLTest/PropertyGroup_plus.gif";
                          }
                     }
                }

                // Now, we determine if the row should be hidden or shown.
                if ( eval(stripTrailing(tr.cells(0).style.paddingLeft, UOM_SIZE)+ INDENT_SIZE) < stripTrailing(trCurrentLeft, UOM_SIZE) && el.src.indexOf( "minus" ) >0 )
                {
                     trCurrent.style.display = sDisplayReverse;
                } else
                {
                     trCurrent.style.display = sDisplay;
                }
           }
      }


      Thanks,
      Kumaravel

      Edited by: 840515 on Feb 28, 2011 10:00 PM