次の方法で共有


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: https://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

  • Anonymous
    September 05, 2005
    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.
  • Anonymous
    September 07, 2005
    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>)
  • Anonymous
    January 12, 2006
    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.
  • Anonymous
    April 18, 2006
    The comment has been removed
  • Anonymous
    April 18, 2006
    Yowsa! I have it working for me on 2003...are you sure you modified / referred to the right .css?
  • Anonymous
    May 04, 2006
    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
  • Anonymous
    July 12, 2006
    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.
  • Anonymous
    July 17, 2006
    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.
  • Anonymous
    July 18, 2006
    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>
  • Anonymous
    July 19, 2006
    The comment has been removed
  • Anonymous
    February 23, 2007
    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
  • Anonymous
    February 23, 2007
    No, I din't think you can change color schemes of the Report Designer toolbar...sorry.
  • Anonymous
    November 26, 2007
    I always wanted to hide the toolbar, except for the parameters. In the alternate stylesheet you can use this:#ReportViewerControl_ctl01 {
    display:none;
    }
  • Anonymous
    October 28, 2010
    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!