11

I am new to SSRS. I have created a report and was able to deploy it on the server. I am calling the report from ASP.NET application. How can I change the CSS of the report? I want to change the styles for individual data cells of the table deing displayed also. How is it possible? Thanks in advance.

2 Answers 2

7

You can customize the CSS at <drive>:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\Stylesor you can specify your own Stylesheet.

See this MSDN article for complete reference: Customizing Style Sheets for HTML Viewer and Report Manager

5
  • I want to change the report table's width to 100% but I was not able to find CSS relating to table's dimensions. It would be great if you can answer it. Thanks for the article. It helped.
    – biluriuday
    Oct 28, 2010 at 6:02
  • In Internet Explorer hit F12 (beginning with IE7, IE6 doesn't have that functionality). It will open the developer toolbar. There you can click on the little arrow in the top-left corner and with that special arrow select the table in the report. You then will see the source code of the page and can target the table (i.e. you will see the class the table has and you can apply CSS styles right away in the developer toolbar). If the developer toolbar is not working you have to manually go through the source of the page.
    – Dennis G
    Oct 28, 2010 at 7:10
  • 1
    So, customized CSS can only be applied server wide, not on a report-by-report basis? Could Bootstrap be used?
    – craig
    Jun 30, 2015 at 14:14
  • You can also use a Stylesheet on a per report basis as explained here: msdn.microsoft.com/en-us/library/ms345247.aspx Bootstrap is not a stylesheet and doesn't really apply to styling reports.
    – Dennis G
    Jul 1, 2015 at 19:50
  • The link provided nowadays does not explain anything about styling on a report basis. Anyone knows where to find this information?
    – Magier
    Aug 31, 2016 at 8:01
2

Magier:

There is a relatively simple way to do this (report by report) when using SSRS URL access to display the reports.

You create custom stylesheets on the report server for whatever different options you want to show or hide (or anything else in the Report Toolbar that you want to customize) and save them to: :\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\Styles

Then, you simply add an &rc:Stylesheet= parameter to the URL you use to display the report, and spec whichever stylesheet you want. Your code can determine what the value of the rc:Stylesheet is:

ie:

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

So as you can see, it can be dynamic, and (as far as I can tell), is the only straightforward way of controlling the ReportViewer styles in SSRS.

Source (same as the above answers, I just wanted to explain how to style on report by report basis): https://msdn.microsoft.com/en-us/library/ms345247.aspx

1
  • Hey, your answer is great but the next question is... how to run a SSRS report with an URL parameter by default? Mar 31, 2021 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.