Answered by:
Cannot add stylesheet to ssrs report

Question
-
I have a stylesheet called MyStyles under \Reporting Services\ReportServer\Styles, when I try to use any stylesheet in this folder in the URL, I am getting an error saying:
Connection to report server could not be stablished.
This is what I have in my Config properties for the report project . This is a single report with no parameters.
Target folder: MyReport
TargetServerURL: /Reportserver/&rs:Command=Render&rc:Stylesheet=HtmlViewerI tried adding this to the URL in the address bar when I open report Manager:
/Reports.aspx?ItemPath=%MyReport&ViewMode=List/&rs:Command=Render&rc:Stylesheet=HtmlViewer
Should not the use of HtmlViewer.css change the font to Verdana? The report does run, but looks the same as before.
I have added this to the RSReportServer.config file:
<HTMLViewerStyleSheet>HtmlViewer</HTMLViewerStyleSheet>
</Configuration>in the Configuration tag.
What am I doing wrong here ? How do I apply a customized stylesheet to a report with and without other parameters?
Wednesday, March 11, 2009 2:16 PM
Answers
-
Another solution, if you don't want to get into coding is to create a new template.
I think that this blog entry would be a good starting point:
http://blogs.msdn.com/bimusings/archive/2005/12/06/500462.aspx
The only thing is that this would probably only work with Business Intelligence Development Studio (BIDS), not Report Builder.- Marked as answer by Raymond-Lee Friday, March 20, 2009 9:08 AM
Wednesday, March 11, 2009 3:17 PM -
I added an barebones .rdl file to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject .
It shows up in the template options when I go to add new report. This is what I will be using to keep all my reports looking consistent.- Marked as answer by Raymond-Lee Friday, March 20, 2009 9:08 AM
Thursday, March 12, 2009 6:39 PM
All replies
-
By the way, when I couldn;t make it work with MyStyles, I tried using the stylesheet that is already in the ReportServer folder, that is,
HtmlViewer. Therefore, the url, etc have that stylesheet name in there.Wednesday, March 11, 2009 2:18 PM -
From what I have read here:
Customizing Style Sheets for HTML Viewer and Report Manager
http://msdn.microsoft.com/en-us/library/ms345247.aspx
The css files can only modify the Toolbar properties:
Reporting Services provides default cascading style sheets (.css) files that define styles for the report toolbar in HTML Viewer and for Report Manager.
Modifying style sheets has no effect on the appearance of published reports that you run on a report server.
Reports that you create in Report Designer use the fonts, colors, and layout that you specify in the report definition.
I'm sorry I can't help you solve your problem, because I think it isn't possible.Wednesday, March 11, 2009 2:55 PM -
Thanks so much for the quick reply.
So how do I create a template that I can use for all of my reports, so all of them are styled the same way.Wednesday, March 11, 2009 3:04 PM -
Indeed, using CSS as a parameter onle enables you to modify the reportviewer. If you want to use a custom CSS on your report items (such as textboxes, rectangles, etc), I suggest creating a custom assembly which gets various values from a CSS file. You should create various classes which return your style and add this to the style properties of a field.
For example:
TextBox1.Background property:
=MyAssembly.MyClass.GetBackground()
The GetBackground method in your MyClass would read it from a CSS file.- Proposed as answer by Majanias Wednesday, March 11, 2009 3:23 PM
Wednesday, March 11, 2009 3:07 PM -
Another solution, if you don't want to get into coding is to create a new template.
I think that this blog entry would be a good starting point:
http://blogs.msdn.com/bimusings/archive/2005/12/06/500462.aspx
The only thing is that this would probably only work with Business Intelligence Development Studio (BIDS), not Report Builder.- Marked as answer by Raymond-Lee Friday, March 20, 2009 9:08 AM
Wednesday, March 11, 2009 3:17 PM -
Thanks very much. I will read up on creating custom assemblies and come back with any other questions I might have. Thanks much for your replies.Wednesday, March 11, 2009 3:19 PM
-
Thanks, Majanias, for sending the link.
After some research, I think it might be easier for me to add a .rdl file to
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
so I will be able to pick the template as a starter to my reports, rather than a blank one.
I am going to start working on that .rdl file. Will keep you posted on my progress.Wednesday, March 11, 2009 4:57 PM -
I added an barebones .rdl file to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject .
It shows up in the template options when I go to add new report. This is what I will be using to keep all my reports looking consistent.- Marked as answer by Raymond-Lee Friday, March 20, 2009 9:08 AM
Thursday, March 12, 2009 6:39 PM