none
How to change the Window title bar while viewing the ssrs report RRS feed

  • Question

  • I am running the report from SSRS report server in the view i am finding that the window title is Report Viewer - Windows Internet Explorer.

    How to remove this name and get the name of the report over there.

    I am using java at the back end to call the repot through url.

    Please help me .

    Thanks ,

    Kamal.

    Wednesday, August 11, 2010 9:12 AM

Answers

  • Hi Kamal,

     

    Because window title in Reporting Services is generated by ReportServer, there is no option to set it by default. As a workaround, we can use Javascript to get the report name in the page and display it in the window title.

    To achieve this, please follow steps below:

    1.    Backup the “Report.aspx” file. By default,  this file located at: C:\Program Files\Microsoft SQL Server\MSRS10.instancename\Reporting Services\ReportManager\Pages

    2.    Open the “Report.aspx” using notepad.

    3.    Add the following code at the end of the file and save.

    <script type="text/javascript">

        var reportName;

        var timer;

        timer = setTimeout("getTitle()", 100);

     

        function getTitle() {

            if (reportName == null || reportName == "") {

                reportName = document.getElementById("ui_sharedArea").firstChild.firstChild.firstChild.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;

                timer = setTimeout("getTitle()", 100);           

            }

            else {

                clearTimeout(timer);

                document.title = reportName;

            }

        }

    </script>

    Now, the report name will be displayed in the window title.

     

    If you have any question, please feel free to ask.

     

    Thanks,

    Tony Chain

     

    Monday, August 16, 2010 5:32 AM
    Moderator

All replies

  • Hi Kamal,

     

    Because window title in Reporting Services is generated by ReportServer, there is no option to set it by default. As a workaround, we can use Javascript to get the report name in the page and display it in the window title.

    To achieve this, please follow steps below:

    1.    Backup the “Report.aspx” file. By default,  this file located at: C:\Program Files\Microsoft SQL Server\MSRS10.instancename\Reporting Services\ReportManager\Pages

    2.    Open the “Report.aspx” using notepad.

    3.    Add the following code at the end of the file and save.

    <script type="text/javascript">

        var reportName;

        var timer;

        timer = setTimeout("getTitle()", 100);

     

        function getTitle() {

            if (reportName == null || reportName == "") {

                reportName = document.getElementById("ui_sharedArea").firstChild.firstChild.firstChild.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;

                timer = setTimeout("getTitle()", 100);           

            }

            else {

                clearTimeout(timer);

                document.title = reportName;

            }

        }

    </script>

    Now, the report name will be displayed in the window title.

     

    If you have any question, please feel free to ask.

     

    Thanks,

    Tony Chain

     

    Monday, August 16, 2010 5:32 AM
    Moderator
  • Hi Tony,

    First of all thanks for the reply

    I got you But How the This java script is working.

    The link which i am sending to the server through java is

    http://spil119/Reports/Pages/ReportViewer.aspx?%2fAPXQAWEB%2fRptCorpAttrByMonth&rs%3aCommand=Render&rs:Format=HTML4.0&rc:Parameters=false&RECORD_ID=

    document.getElementById("ui_sharedArea").firstChild.firstChild.firstChild.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue

    so the report name should be RPTCorpAttrByMonth will this work and please tell me how it is working

    I am new to all this.

    Thanks

    Kamal

     

    Friday, August 27, 2010 10:22 AM
  • Hi Kamal,

    The JavaScript might be added to the “Report.aspx” file which on the Report Server, please refer to the steps I posted. Then you don’t need to change the Url to call the report and the report name will be displayed on the Window Title automatically.

    Hope this helps.

     

    Thanks,

    Tony Chain

    Monday, August 30, 2010 4:31 AM
    Moderator
  • Tony,

    Looking for something around the same lines except what the title to be the InitialPageName.

    Is it possible to access this attribute?

    Cheers,

    Ozzy

    Saturday, April 28, 2012 5:33 PM