I didn't know about this non-interactive execution mode.
Original Message:
Sent: Wed October 23, 2024 02:25 PM
From: David Parks
Subject: Link/buttons to go to tabs in Report
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
Original Message:
Sent: Tue October 22, 2024 05:32 PM
From: Gustavo Andrade
Subject: Link/buttons to go to tabs in Report
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
Original Message:
Sent: Tue October 22, 2024 03:38 PM
From: David Parks
Subject: Link/buttons to go to tabs in Report
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
Original Message:
Sent: Thu October 17, 2024 03:20 PM
From: Gustavo Andrade
Subject: Link/buttons to go to tabs in Report
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
------------------------------