{"id":41,"date":"2012-11-03T15:55:00","date_gmt":"2012-11-03T15:55:00","guid":{"rendered":"\/lisa\/post\/2012\/11\/03\/YAPS-again-about-RS-2008-R2-Branding.aspx"},"modified":"2012-11-03T15:55:00","modified_gmt":"2012-11-03T15:55:00","slug":"yaps-again-about-rs-2008-r2-branding","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2012\/11\/03\/yaps-again-about-rs-2008-r2-branding\/","title":{"rendered":"YAPS again about RS 2008 R2 Branding"},"content":{"rendered":"<p>Oh, all right.<\/p>\n<p>I was not at all surprised when <a title=\"blog post helping Octoni do what s\/he said, but with the sad feeling it wasn't what s\/he needed, last time\" href=\"\/lisa\/2012\/10\/31\/YAPS-about-SSRS-Branding-in-2008-R2\/\">Octoni wrote back to say<\/a> &#8220;but can&#8217;t we just hide the right-side link to Home with CSS&#8221;?<\/p>\n<p>Apparently s\/he just noticed it. I did try to say.<\/p>\n<p>Well, I don&#8217;t think you can do this with CSS, because it&#8217;s in a table cell with a bunch of other content.&nbsp; But below a quick and dirty sketch to show you how you can put a little javascript in the affected ASPX pages (look under ReportManager\/Pages) to do what Octoni wants.<\/p>\n<p class=\"NB\">I still say this isn&#8217;t going to work too well&nbsp;&#8212; because users can still get to the Home page just by looking at&nbsp;the current&nbsp;URL in the Report Manager, wherever they happen to be,&nbsp;and slicing off the end of it.<\/p>\n<p>I had to borrow some code to add load-time functionality into the Report Manager ASPX pages, which I got from <a title=\"handy dandy loader script\" href=\"http:\/\/www.sitepoint.com\/forums\/showthread.php?645490-Run-Javascript-Only-After-Page-Finishes-Loading\" target=\"_blank\" rel=\"noopener\">here<\/a> &#8212; because you need this code to run only after everything else is finished in the internal ASP.NET Report Manager code.&nbsp; If you don&#8217;t delay this activity, there aren&#8217;t any tables available for your javascript to see and adjust.<\/p>\n<p>This quick and dirty&nbsp;example worked for me in the Folder.aspx page.<\/p>\n<p class=\"code\"><span style=\"color: #0000ff;\">&lt;<\/span><span style=\"color: #800000;\">script <\/span><span style=\"color: #ff0000;\">type<\/span><span style=\"color: #0000ff;\">=&#8221;text\/javascript&#8221;<\/span><span style=\"color: #ff0000;\">id<\/span><span style=\"color: #0000ff;\">=&#8221;LSNClientSideSSRSReportManagerCode&#8221;&gt;<\/span> <\/p>\n<p>addLoadListener(HideRightSideHomeLink);<\/p>\n<p><span style=\"color: #0000ff;\">function<\/span> <span>HideRightSideHomeLink() {<\/p>\n<p><\/span><span style=\"color: #0000ff;\">&nbsp;&nbsp; var<\/span> bcTable = document.getElementsByTagName(<span style=\"color: #800000;\">&#8220;table&#8221;<\/span> )[1];<br \/><span style=\"color: #006400;\">&nbsp;&nbsp; \/\/ you may not be able to depend on this explicit index, <\/span><span style=\"color: #006400;\"><br \/>&nbsp;&nbsp; \/\/you may need to iterate through and look for <\/span><span style=\"color: #006400;\"><br \/>&nbsp;&nbsp; \/\/ the one with className = &#8220;msrs-topBreadcrumb&#8221;<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #006400;\">\/\/ might be different for each ASPX page for all I know&#8230;<\/span>&nbsp;<br \/>&nbsp;&nbsp; <span style=\"color: #0000ff;\">var<\/span> <span>td = bcTable.rows[0].cells[1];<br \/>&nbsp;&nbsp; <\/span>&nbsp;td.innerHTML = td.innerHTML.replace( <span style=\"color: #800000;\">&#8216;Home&#8217;<\/span> , <span style=\"color: #800000;\">&#8221;<\/span> );<br \/>&nbsp;} <\/p>\n<p><span style=\"color: #006400;\">\/\/ the following function from <br \/>\/\/ <a href=\"http:\/\/www.sitepoint.com\/forums\/showthread.php\">http:\/\/www.sitepoint.com\/forums\/showthread.php<\/a>? <br \/>645490-Run-Javascript-Only-After-Page-Finishes-Loading<\/span> <\/p>\n<p><span style=\"color: #0000ff;\">function<\/span> <span>addLoadListener(fn) {<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #006400;\">\/\/mozilla and friends<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #0000ff;\">if<\/span> (<span style=\"color: #0000ff;\">typeof<\/span> window.addEventListener != <span style=\"color: #800000;\">&#8216;undefined&#8217;<\/span> ) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;window.addEventListener( <span style=\"color: #800000;\">&#8216;load&#8217;<\/span> , fn, <span style=\"color: #0000ff;\">false<\/span> ); <br \/>&nbsp;&nbsp; } <br \/>&nbsp;&nbsp; <span style=\"color: #006400;\">\/\/opera<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #0000ff;\">else<\/span><span style=\"color: #0000ff;\">if<\/span> (<span style=\"color: #0000ff;\">typeof<\/span> document.addEventListener != <span style=\"color: #800000;\">&#8216;undefined&#8217;<\/span> ) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;document.addEventListener( <span style=\"color: #800000;\">&#8216;load&#8217;<\/span> , fn, <span style=\"color: #0000ff;\">false<\/span> ); <br \/>&nbsp;&nbsp; } <br \/>&nbsp;&nbsp; <span style=\"color: #006400;\">\/\/innernetz exploder<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #0000ff;\">else<\/span><span style=\"color: #0000ff;\">if<\/span> (<span style=\"color: #0000ff;\">typeof<\/span> window.attachEvent != <span style=\"color: #800000;\">&#8216;undefined&#8217;<\/span> ) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;window.attachEvent(<span style=\"color: #800000;\">&#8216;onload&#8217;<\/span> , fn); <br \/>&nbsp;&nbsp; } <br \/>&nbsp;&nbsp; <span style=\"color: #006400;\">\/\/the rest is pretty much for browsers that I doubt your <br \/>&nbsp;&nbsp; <\/span><span style=\"color: #006400;\">\/\/CSS or anything else still supports like IE\/Mac<\/span> <br \/>&nbsp;&nbsp; <span style=\"color: #0000ff;\">else<\/span> {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<span style=\"color: #0000ff;\">var<\/span> <span>oldfn = window.onload;<\/span> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"color: #0000ff;\">if<\/span> (<span style=\"color: #0000ff;\">typeof<\/span> window.onload != <span style=\"color: #800000;\">&#8216;function&#8217;<\/span> ) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;window.onload = fn; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"color: #0000ff;\">else<\/span> {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;window.onload =<span style=\"color: #0000ff;\">function<\/span> () {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;oldfn(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fn();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}<br \/>&nbsp;&nbsp; &nbsp;} <br \/>&lt;\/<span style=\"color: #800000;\">script<\/span><span style=\"color: #0000ff;\">&gt;<\/span><\/p>\n<p>I imagine the *.aspx pages for Report Manager&nbsp;would all work similarly. And there&#8217;s probably a better way to do this by subclassing the Report Manager UI classes, but I&#8217;m not going to go there, because I think the whole thing is a really bad idea.<\/p>\n<h2>Repeat after me:<\/h2>\n<p><em>I will not fight with the Report Manager UI.&nbsp; <a title=\"blog post on nixing the Report Manager\" href=\"\/lisa\/2011\/07\/03\/Nixing-the-Report-Manager\/\">I will turn my back on it, and&nbsp;build a better one for my users<\/a>.<\/em><\/p>\n<p>Only when you start talking about the Report Manager does the idea of mediocrity become inextricably associated with SQL Server Reporting Services.<\/p>\n<p>Funny. I <a title=\"proto blog post about why I never used FPW\" href=\"https:\/\/spacefold.com\/lisa\/archive\/retirement-home\"\/>used to say<\/a> something very similar about FoxPro for Windows, in a universe long ago and far away.&nbsp; Or, maybe not so funny.<\/p>\n<p>I&#8217;m getting too old for this type of nonsense.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oh, all right. I was not at all surprised when Octoni wrote back to say &#8220;but can&#8217;t we just hide the right-side link to Home with CSS&#8221;? Apparently s\/he just noticed it. I did try to say. Well, I don&#8217;t think you can do this with CSS, because it&#8217;s in a table cell with a<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2012\/11\/03\/yaps-again-about-rs-2008-r2-branding\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5,6,12],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-reporting","category-sql-server","category-yaps"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}