Sections Horizontally in OBIEE11g Pivot View — Oracle Analytics

Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Sections Horizontally in OBIEE11g Pivot View

Received Response
41
Views
5
Comments
Deepthi Suravaram
Deepthi Suravaram Rank 5 - Community Champion

Hi Gurus,

Is there a way to have the sections come up horizontally instead of vertically in OBIEE 11g? I have seen lot of posts related to this in 10g using javascript, but those scripts are no longer valid for 11g I suppose.

Please let me know if there is a modified script or a new way of achieving this functionality.

Regards,

Deep

Answers

  • As you saw it's about pieces of JS / CSS.

    Many posted the same questions on here and I can't remember a single one coming back to post his piece of code (if they did it).

    So it's up to you to get your hands into the code.

    (As far as I remind it isn't too complicated...)

  • Andrew Fomin.
    Andrew Fomin. Rank 6 - Analytics Lead

    It looks like this code can solve the problem (not mine, found on the Internet): Edit fiddle - JSFiddle

    I tried to redefine styles that way and my table sections became horizontal. Unfortunately, that brakes OBIEE UI completely so you need to find out which styles should be changed.

  • DPal
    DPal Rank 1 - Community Starter

    Version: OBIEE 11.1.1.6.9

    Put the following script in Static Text.

    <script type="text/javascript">

    var intColumnNumbers = 2;       /*Put the number of vertical lines required*/

    var sectioncnt =0;

    var x=0;

    var nw_tr =new Array();

    var tables = document.getElementsByTagName('table');

    var pt_tables = new Array();

    var cnt=0;

    /*Take all PTSectionTables in an array*/

    for(var table=0;table<tables.length;table++)

    {

      if(tables[table].className == 'PTSectionTable' )

      {

         pt_tables[cnt++]=tables[table];

      }

    }

    for(var table=0; table < pt_tables.length;)

    {

      var new_tr = document.createElement('tr');

      do

      {

      var par_tr=pt_tables[table].parentElement.parentElement; /*Capture <tr> element containing section header.*/

            var par_tr1=par_tr;

      var sib_tr; /*Capture <tr> element containing section body.*/

            while((sib_tr=par_tr1.nextSibling).nodeType !== 1){

                               par_tr1=par_tr1.nextSibling;

            }

      var tbody= par_tr.parentElement;

      var new_td = document.createElement('td');

      var new_table = document.createElement('table');

      var new_tbody = document.createElement('tbody');

      new_tbody.appendChild(par_tr);

      new_tbody.appendChild(sib_tr);

      new_table.appendChild(new_tbody);

      new_table.style.border="1px solid black";    /*new_table conatains section header and body together*/

       new_td.appendChild(new_table);

      new_tr.appendChild(new_td);

      table++;

      if(table===pt_tables.length)

      break;

      sectioncnt = sectioncnt +1;  

      }while((sectioncnt%intColumnNumbers) !==0);

        nw_tr[x] = document.createElement('tr');

        nw_tr[x]=new_tr;

        var new_tr = document.createElement('tr');

        x =x+1;   

    }

    for (y=0; y<nw_tr.length; y++)

         {

              tbody.appendChild(nw_tr[y]);

         }

    </script> 

    Regards,

    Debasmita

  • 1838333
    1838333 Rank 1 - Community Starter

    The above mentioned code is working fine in 11.1.1.6.9. Will give update about the higher versions 11.1.1.7 later.

    This code is bug free.

    Thanks,

    Santanu

  • Deepthi Suravaram
    Deepthi Suravaram Rank 5 - Community Champion

    Yes this works in 11.1.1.9 Thanks