Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
Expand all | Collapse all

Link/buttons to go to tabs in Report

  • 1.  Link/buttons to go to tabs in Report

    Posted Thu October 17, 2024 03:20 PM
    Edited by Gustavo Andrade Thu October 17, 2024 03:22 PM

    Hello everyone, in a report-type project, is it possible to create links/buttons so that when you click on them, you can go to one of the tabs in the report itself?

    (This is possible to do in dashboard mode, but my project is in report mode.)



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 2.  RE: Link/buttons to go to tabs in Report

    Posted Thu October 17, 2024 05:02 PM

    The easiest way is creating a separate report Page for each Tab.

    And set Report property: View pages as tabs

    Other solution would require a Custom Control. Look at the Cognos samples.


    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------



  • 3.  RE: Link/buttons to go to tabs in Report

    Posted Thu October 17, 2024 05:10 PM

    Hello Andrei, the report is already configured this way. Each tab is a different report.

    The question is whether I can click on the links on the presentation tab (Home) and load the respective tab (without necessarily clicking on the tab). As if it were going to open a new report, but instead it opens the tab itself.



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 4.  RE: Link/buttons to go to tabs in Report

    Posted Fri October 18, 2024 02:44 AM
    Edited by Robert Dostal Fri October 18, 2024 02:46 AM

    Hi Gustavo,

    Oldschool I would create a string variable with a parameter link this variable to each page as render variable so each page will only be displayed when the variable is set and then define drill-throughs for the report to call itself and pass the corresponding variable value.

    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
    Ingelfingen
    ------------------------------



  • 5.  RE: Link/buttons to go to tabs in Report

    Posted Fri October 18, 2024 02:48 AM
    Edited by Robert Dostal Fri October 18, 2024 02:52 AM
      |   view attached

    Here's the file with the screenshots.



    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
    Ingelfingen
    ------------------------------

    Attachment(s)

    docx
    manual navigation.docx   283 KB 1 version


  • 6.  RE: Link/buttons to go to tabs in Report

    Posted Fri October 18, 2024 03:21 PM

    Thanks Robert, I'll try to replicate your example to understand better and report back.



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 7.  RE: Link/buttons to go to tabs in Report

    Posted Fri October 18, 2024 07:33 AM

    > Each tab is a different report.

    How is it even possible to define a Tab as a different report using OOTB functionality?

    I guess I do not quite understand what you are trying to achieve.

    If you need to create a navigation to different reports then @Robert Dostal 's example should suffice.

    I would just add that you can implement the Navigation part in a separate report and reference it  as a Layout Component Reference in the Drill-through reports.

    But it is an old School :-) . It would run a full report reload every time you click on the Button/Link.

    With Custom Control you can do it much more efficiently.



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------



  • 8.  RE: Link/buttons to go to tabs in Report

    Posted Fri October 18, 2024 03:23 PM

    Hi Andrei, 
    I expressed myself incorrectly, this is no different report.
    Each report tab is a different topic, with data from different datasets and measures.



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 9.  RE: Link/buttons to go to tabs in Report

    Posted Sun October 20, 2024 10:34 AM

    >Each report tab is a different topic, with data from different datasets and measures.

    Then conditional rendering would work.

    Though, I'm still puzzled why you can't simply use the OOTB tabs? :-)



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------



  • 10.  RE: Link/buttons to go to tabs in Report

    Posted Mon October 21, 2024 09:12 AM

    I don't quite understand, what exactly is OOTB tabs?



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 11.  RE: Link/buttons to go to tabs in Report

    Posted Mon October 21, 2024 11:48 AM

    OOTB:  Out-Of-The-Box . Existing functionality of the product.



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------



  • 12.  RE: Link/buttons to go to tabs in Report

    Posted Mon October 21, 2024 02:47 AM

    Hi,

    What happens to the URL when you switch between tabs? There is perhaps a parameter il the URL than you can use for your link.

    Creating custom URLs to display and run Cognos Analytics content - IBM Documentation

    BR,

    German



    ------------------------------
    German Rodriguez
    ------------------------------



  • 13.  RE: Link/buttons to go to tabs in Report

    Posted Mon October 21, 2024 10:33 AM
    Edited by Robert Dostal Mon October 21, 2024 10:33 AM

    There's a property in the pane when you select just the report which is called "View pages as tabs".

    Robert.Dostal@gemue.de - Outlook-L.jpeg" class="media-object tinymce-editor-img img-responsive" title="tab setting" data-title="tab setting" width="400" data-modalsrc="https://higherlogicdownload.s3.amazonaws.com/IMWUC/UploadedImages/hNVEuFVjSgW9I2BugVyW_2024-10-21 16_29_51-IBM Community - Robert.Dostal@gemue.de - Outlook.jpeg" data-imgbase="https://higherlogicdownload.s3.amazonaws.com/IMWUC/UploadedImages/hNVEuFVjSgW9I2BugVyW_2024-10-21 16_29_51-IBM Community - Robert.Dostal@gemue.de - Outlook.jpeg" data-imgthumbnail="https://higherlogicdownload.s3.amazonaws.com/IMWUC/UploadedImages/hNVEuFVjSgW9I2BugVyW_2024-10-21 16_29_51-IBM Community - Robert.Dostal@gemue.de - Outlook-T.jpeg" data-imgmedium="https://higherlogicdownload.s3.amazonaws.com/IMWUC/UploadedImages/hNVEuFVjSgW9I2BugVyW_2024-10-21 16_29_51-IBM Community - Robert.Dostal@gemue.de - Outlook-M.jpeg" data-imglarge="https://higherlogicdownload.s3.amazonaws.com/IMWUC/UploadedImages/hNVEuFVjSgW9I2BugVyW_2024-10-21 16_29_51-IBM Community - Robert.Dostal@gemue.de - Outlook-L.jpeg">

    Set it to "Yes".



    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
    Ingelfingen
    ------------------------------



  • 14.  RE: Link/buttons to go to tabs in Report

    Posted Tue October 22, 2024 05:35 PM

    Hi Robert, yes, my report already has these parameters marked to view as tabs.



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 15.  RE: Link/buttons to go to tabs in Report

    Posted Tue October 22, 2024 03:38 PM
    Edited by David Parks Tue October 22, 2024 03:38 PM
      |   view attached

    Good day Gustavo,

    I've attached an example of tab navigation using JavaScript that I did a while ago. It uses links and not buttons but again that's a simple change that could be made with the proper code change.

    It only works in Classic mode rendering and not Interactive mode but I'm sure it's methodology could be adopted into a Custom Control. The Classic version of the JavaScript code has been working for us for quite a while and survived a version upgrade. We've had no issues with web browser upgrades either since the code is quite basic.

    I'm not a JavaScript programmer by any stretch so I'm sure there's room for improvement. It's a start but certainly not an end.

    Thanks and have a great day.



    ------------------------------
    David Parks
    Senior Business Intelligence Analyst
    ------------------------------

    Attachment(s)



  • 16.  RE: Link/buttons to go to tabs in Report

    Posted Tue October 22, 2024 05:32 PM

    Hi David,
    Interesting, it seems to be what I need.

    I was unable to import this xml into my report, is there anything I need to adapt first?

    I would like to test it to see if it is what I think.



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------



  • 17.  RE: Link/buttons to go to tabs in Report
    Best Answer

    Posted Wed October 23, 2024 02:25 PM
    Edited by Gustavo Andrade Wed October 23, 2024 05:16 PM

    Good afternoon Gustavo,

    I attached the entire report specification originally. Just open the report from clipboard and paste the contents in and then set the Report render mode to classic as in non-interactive under the main Report entry in Report Studio and it should work. I've pasted the JavaScript below which should be on each tab page to work properly.

    To define the navigate_Tab function, copy and paste this in an HTML Item:

    <script language="JavaScript">
    function navigate_Tab(str_Tab_Name) {
      
      // Check if tabs have been loaded
      var nodelist_Tabs = document.querySelectorAll("div div [role='tablist'] span")
      if(nodelist_Tabs) {
        
        // Loop through all tabs in report
        for (let int_Index_Tablist = 0; int_Index_Tablist < nodelist_Tabs.length; int_Index_Tablist++) {
          
          // Determine if this tab's name is the same as str_Tab_Name
          if(nodelist_Tabs[int_Index_Tablist].innerHTML == str_Tab_Name) {
            console.log(nodelist_Tabs[int_Index_Tablist].innerHTML);
     
            // Click on tab
            nodelist_Tabs[int_Index_Tablist].parentNode.parentNode.dispatchEvent(new Event("mousedown"));
            return;
            
          } // End if
     
        } // End for
     
        console.log("Not Found");
     
      } // End if
     
    } // End function navigate_Tab
    </script>

    To create the links to a tab, copy and paste this in an HTML Item and change the static text 'Tab 1' to the name of the tab want to navigate to. The link text can be changed as well to whatever you would like:

    <a href="#" onclick="navigate_Tab('Tab 1');" class="hy">Tab 1</a>

    Again lots of different ways you can implement and spice this up but this is just a very basic example. Thanks and have a great day.



    ------------------------------
    David Parks
    Financial Systems Analyst
    ------------------------------



  • 18.  RE: Link/buttons to go to tabs in Report

    Posted Wed October 23, 2024 05:17 PM

    Hi david,

    It worked correctly, thank you very much!

    I didn't know about this non-interactive execution mode.

    Thanks to everyone who helped



    ------------------------------
    Gustavo Andrade
    Data Analyst
    ------------------------------