views:

343

answers:

4

I've got a batch of reports to which certain changes need to be applied in how the reports are presented. I know how to modify the Reporting Services stylesheet but is it also possible to apply custom CSS classes to items as they are rendered to the browser?

Does Reporting Services support any type of Visual Inheritance that I could use to accomplish similar functionality in a different way?

+1  A: 

Taken From ASP.NET Forums

Microsoft provides a style sheet named ReportingServices.css that is used by SQL Server Reporting Services. For my local workstation installation this style sheet is found in the c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager\Styles folder. The classes that are referenced by different html elements are predefined in this style sheet. You style your reports by editing this style sheet.

There is no link to this style sheet in a report's html. There is, however, an inline style section in the html rendered for each report. I believe that Microsoft creates the inline style section based on the contents of ReportingServices.css. Doing it this way (rather than allowing you to link in your own style sheet) allows the report rendering engine to have the knowledge it needs to control page breaks, column wrapping, and other formatting issues.

TheTXI
I've actually found this stylesheet and have made modifications to it. I was trying to find out whether there was any support to allow me to create and use custom classes beyond what is predefined and apply those custom classes to elements in the report. If this is not possible then I wanted to see if there were any type of visual inheritance mechanism in Reporting Services that I am overlooking.
Joel
A: 

There are some articles on SqlCentral.com which are showing how to apply Style in a different (and centralized) way:

http://www.sqlservercentral.com/articles/Reporting+Services/65853/ http://www.sqlservercentral.com/articles/Reporting+Services/65811/

Visual Inheritance is not supported.

EricSch
A: 

From "Customizing Style Sheets for HTML Viewer and Report Manager" (http://technet.microsoft.com/en-us/library/ms345247%28SQL.90%29.aspx)

You can use the rc:StyleSheet URL access parameter to specify a custom style sheet on the report URL.

http://localhost/reportserver?/AdventureWorksSampleReports/Product+Line+Sales&rs:Command=Render&rc:Stylesheet=MyStyleSheet

Bigwave
A: 

See http://www.simple-talk.com/sql/reporting-services/reporting-services-with-style/ for what I think is a better way of doing this, and easy to implement, you can even put the datasource for your style into a template, so the dev building reports just uses the template, and it's already there.

jonmcrawford