How to hide items in the HTML Toolbar control for SQL Server 2000 Reporting Services


This is kind of old news since the feature has been around since SP1, but I haven’t really played around with it until now: You can control the look and feel of the HTML report toolbar by using a custom cascading stylesheet and URL Access.


If you take a look in the C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\styles folder, you’ll see a sample css named htmlviewer.css (and if you’ve installed SP2, you get some new ones: SP_Full.css and SP_Small.css). Anyway, you can use the css to change the color and position of items in the toolbar, and even go so far as to hide them.


So, let’s say for example that I don’t want the toolbar to show the “Find”, “Zoom”, “Export” and “Print” parts of the interface…but I do want to continue to display the “Refresh” button:  I’d just make a copy of the htmlviewer.css to work from and make the following modificatons:


.ToolbarFind


{
            display: none;
}


.ToolbarExport


{
            display: none;
}


.ToolbarZoom


{
            display: none;
}


.ToolbarRefresh


{
            display: inline;
}
.ToolbarPrint


{
            display: none;
}


I’ll save this css as “test.css” in the \styles folder.


Then, to display my report, I’d use URL Access: http://myReportServer/reportserver?/MyReport&rs:Command=Render&rc:Stylesheet=test


The only problem I had was due to a (dumb) assumption I made. If you review the SP1 readme closely, you won’t make the same mistake, but I thought that htmlviewer.css always provided style info to Report Manager unless we specified a different one with the Stylesheet parameter. So, I got confused when I modified htmlviewer.css, but the changes didn’t get reflected when I browsed reports without specifying any stylesheet. To get this feature to work you *must* actually specify a css name.


 


 

Comments (14)

  1. Anonymous says:

    Any ideas where I can find a list of all the style classes used in RS. I want to have complete control of all items including using absolute positioning. A reference page would be just fine.

  2. As far as I know, there is no such animal (at least as documented by MSFT)…you might try Googling it (MSN-ing it? <G>)

  3. Anonymous says:

    Thank you very much.

    I was able to edit the MS SQL Reporting Services file that displays the Report Toobar but needed that piece for testing.

    This helped and avoided a great deal of aggravation.

  4. Anonymous says:

    I have this working I am able to remove items from the toolbar, even fixed the problem on firefox where the toolbar renders too high.

    The major problem I am having is that it only works when reporting services is installed on a machine running windows xp. The style does not seem to get applied to machines running 2000 or 2003

  5. Yowsa! I have it working for me on 2003…are you sure you modified / referred to the right .css?

  6. Anonymous says:

    When should we copy .css file?  

    Under this

    "C:Program FilesMicrosoft SQL ServerMSSQLReporting ServicesReportServerstyles"

    or

    under virtual directory of my web appl

    kindly help me

  7. Anonymous says:

    It’s very helpful and good article.

    but can we make the changes in main "htmlviewer.css" and we got the reflected changes in all the reportserver reports.so by doing this we don’t have to make another copy of css file and give "rc:Stylesheet=cssfilename".

    i have also second question is there any way by which we can pass "rc:Stylesheet=cssfilename" URL to parent report to child report(by drilling down-jump to report) method.

    thanks in advance.

  8. Anonymous says:

    Hi .

    I had made the changes in respective CSS file for hiding print icon in report toolbar and deployed report in local reporting service machine (LAN) and our onsite machine.

    but the problem i am facing is when i am accessing my local reporting server machine at that time print icon is not visible.so it’s as per my requirement. but when i am accessing our onsite machine reporting server at that time i seen print icon and it’s only seen in my PC, my other team members doesn’t seen that print icon both on local reporting service machine and onsite reporting service machine.

    can anyone help me out in this issue, because it’s very urgent ..

    Thanks,

    Sanket.

  9. Sanket, the technique you used isn’t really supported. I don’t understand why it doesn’t work, but we have an "official" way you are supposed do to this rather than editing the default htmlviewer.css file:

    0. Make a copy of the htmlviewer.css and make changes in the copy.

    –  Add <HTMLViewerStyleSheet> element in RSReportServer.config within the <configuration> element.

    – Reference the copy of the stylesheet you created above inside this element

    NOTE: Don’t include the “.css” extension in the name of the style sheet.

    EXAMPLE:

    <HTMLViewerStyleSheet>AnotherHTMLViewerStyleSheet</HTMLViewerStyleSheet>

  10. Anonymous says:

    Hi russch,

    Thanks for the post.

    now i am also not seeing print icon in onsite machine, i don’t know the excat reason, i read somewhere about restarting IIS, so i just execute IISReset command and it’s working.

    i haven’t add <HTMLViewerStyleSheet> element in RSReportServer.config file, is it necesaary for doing something for report server toolbar ?

    Sanket.

  11. Anonymous says:

    Hi russch,

    This was a great post on modifying the html viewer, or toolbar on the reporting services. However, would this reflect on the reporting designer as well ? I noticed that the color scheme for the report designer is different than what you would see in a report online. Is there a config file that is responsible for this ? I know that there is a reportdesigner.config ,and I was wondering whether I have to insert the <HTMLViewerStyleSheet> tag in this config file so that I can see it ?

    Thank you !

    Bernard Ong

  12. No, I din’t think you can change color schemes of the Report Designer toolbar…sorry.

  13. dragoon says:

    I always wanted to hide the toolbar, except for the parameters. In the alternate stylesheet you can use this:

    #ReportViewerControl_ctl01 {

    display:none;
    

    }

  14. Steve says:

    Hello,

    I have modified the htmlviewer.css in sql server 2000 reporting and have a report displayed as expected on various server machines which I am able to log on via IE6, IE7, and IE8. When viewing a report on my PC which is XP with IE8, the report ignores the modified CSS and renders with default settings. I also tried on my laptop (XP and IE8) and got the same resuluts. Rebooting and deleting temp files did not solve the issue.

    Does any one have any idea on how to fix the issue?

    Thanks a lot!