COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: jriley on 09 Aug 2019 03:25:28 PM

Title: Custom HTML print buttons on Tabbed Reports
Post by: jriley on 09 Aug 2019 03:25:28 PM
Hi All,

We have created custom print buttons for our reports to match our applications button style, size, color, etc.  They look fine except when we apply these to tabbed reports.  The updated version will look fine on the initial tab of the report BUT will revert to basic style and appearance on the subsequent tabs.  Thinking the HTML only fires on the initial opening of the report and is not triggered to parse it once again for the second or subsequent tab of the report.  Looking inconsistent from tab to tab. 

Any thoughts on how we can tell Cognos to refresh the tab upon opening to trigger the parsing of the html to set the buttons for the updated design?  Attached screenshot for visual. 

Thanks,
Joe
Title: Re: Custom HTML print buttons on Tabbed Reports
Post by: jriley on 12 Aug 2020 08:46:58 PM
I resolved this problem finally by moving the HTML item containing the 'script' with style applied AFTER the HTML item creating the button.  Figured out the 'script' first did not apply because the 'button' hadn't yet been recognized in the parsing of the code, so nothing to apply 'style' to..as far as it knew. 

Also, forgot to mention, I changed the 'id' for the second (or subsequent) buttons on the other tabs.  then updated script to reference the new id. 

i.e.  2nd tab reset to  id="button2PDF" in 'button' html item.  in 'script' html item, updated references to the new id.  document.getElementById("button2PDF")

Thanks,
Joe