RSviewerpage.aspx

Hi,

Is it possible to display the name of the report when the rsviewerpage.aspx is opened  in the title area  or by the breadcrumbs ?

Any suggections would be appreciated.

Thanks and regards

JM

April 29th, 2014 12:54pm

Hi,

For your requirement, a workaround is modify the RSviewerpage.aspx by adding JavaScript into it to add some text at the end of the breadcrumb.

By default, this page locates here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ReportServer

As you want to display the name of the report on this page, we will need to get the name of the report first, then insert it into a place in this page.

As we can see, the title of the current page is Reporting Services report1, then "report1" would be the name of the report, we can retrieve the string and extract the substring report1 from it using JavaScript.

How to get the title of the page

http://www.w3schools.com/jsref/prop_doc_title.asp

Get Substring of string

http://stackoverflow.com/questions/14867835/get-substring-between-two-characters-using-javascript

With the name of the report, we can now insert it into the place you want in this page.

Generating and injecting HTML content with Javascript and jQuery

http://mattfrear.com/2010/03/01/generating-and-injecting-html/

Here is a code demo for your reference:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">

$(function(){
  var title = document.title.substring(21);

  var injectHtml = "<span> > ";
  injectHtml += title;
  injectHtml += "</span>"

  var $t = $('table.ms-rtePosition-1 td');
  $t.append(injectHtml);

});
</script>

The outcome is:

Best regards
Free Windows Admin Tool Kit Click here and download it now
May 1st, 2014 6:42am

Thank you it worked perfectly!!!
May 1st, 2014 12:43pm

Hi, Is it possible to do this without modifying the RSViewerPage.aspx page, like by adding the script to the master page?
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2015 3:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics