Add Styles to Your Reporting Services Reports

  • Good article... waiting for the rest 🙂

    Brian

    Regards
    Brian Ellul
    ----------------------------------------------------------------------------------
    Computers are incredibly fast, accurate, and stupid. Human beings are incredibly slow, inaccurate, and brilliant. Together they are powerful beyond imagination.
    - Albert Einstein -

  • very informative! Thanks!

  • Several people mentioned storing the attributes in the database, then extracting them via a dataset. Barry King has a very nice blog post about this (as a reaction to Adam's article originally being published) here, and we've implemented it at work as described. Works very well, easy to maintain, don't have to touch the reports at all. Only caveat (you'll see it in the comments of the post) is that in header/footer areas you need to map the dataset value to a parameter, but that's simple enough.

    We actually created a template for the team that includes the style dataset and header/footer elements (like logo, dept header, report name, global rundate, page numbers, confidentiality notice, etc) so that team members creating new reports don't have to do a thing in order to implement the default style. Saves a ton of time.

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • This article has been featured several times on SSC and I read it every time. However I just can't get past

    Fourthly it is not possible to define a style which encompasses all the attributes of an object. For instance a font has a font family, colour, size and weight (and this list is not exhaustive). You will have to define a style for each individual element, unfortunately, as this is a limitation of BIDS. However, as there is no limit to the number of functions that you can add to the code tab in the Report properties dialog, there is nothing to stop you having different functions for each type of property that you wish to set dynamically.

    As a result, using styles like this just seems to make me type more. Typing in one of the standard colors that I use, or font weight, or size, etc. is less typing than the expression to call the code. The key however, is that I have very standardized reports and I know what settings I want and where, many are already built into my template.

    Let me end by saying that I love the thinking here, in HTML styles are a way to make things easier to write and maintain. This is certainly a worthy endeavour for SSRS, but this approach just seems like a bit more overhead than the standard way.

  • It might seem like a lot of typing at the onset (and it is), but it will save huge time down the road. AND the concept gives me [maybe] even more control over my style elements than using a typical cascading style sheet--anything I can manipulate in my SSRS report via an expression can be styled dynamically. I can pay attention to as much or as little as I want. I like that.

    I created a process that basically dumps delimited text files into the tables via SQL scripting, so initial population is easy-peasy. Initially coming up with the style sets takes some time, but it's well worth the effort.

    :w00t:

  • Not sure if it has been brought up yet, did not have time to go through the previous comments. however: http://technet.microsoft.com/en-us/library/ms345247.aspx

  • Thanks SPCGHST440,

    CSS can be used to configure the report manager toolbar, but not the report contents. Here is an excerpt from that very page:

    Modifying style sheets has no effect on the appearance of published reports that you run on a report server. In Reporting Services, reports do not reference style sheets. Ad hoc reports that are auto-generated by the report server use style information that is stored as an embedded resource in the report server program files. Reports that you create in Report Designer use the fonts, colors, and layout that you specify in the report definition. Styles are created inline with the rest of the layout.

    Which is quite puzzling. If Microsoft took the time to partially support CSS, why not go full monty!? You still need an alternative way to dynamically style the report contents, which is what we're discussing here. Thanks for your input!

    🙂

  • Ah, ty. That is LAME. They should give you the option to choose or to even mix and match. 😀

  • SQLMeat (10/8/2010)


    Thanks SPCGHST440,

    CSS can be used to configure the report manager toolbar, but not the report contents. Here is an excerpt from that very page:

    Modifying style sheets has no effect on the appearance of published reports that you run on a report server. In Reporting Services, reports do not reference style sheets. Ad hoc reports that are auto-generated by the report server use style information that is stored as an embedded resource in the report server program files. Reports that you create in Report Designer use the fonts, colors, and layout that you specify in the report definition. Styles are created inline with the rest of the layout.

    Which is quite puzzling. If Microsoft took the time to partially support CSS, why not go full monty!? You still need an alternative way to dynamically style the report contents, which is what we're discussing here. Thanks for your input!

    🙂

    Don't quote me on this but I think this makes sense. The Report Manager is a web app that is subject to style sheets. However I believe the reports are rendered before they get to the report manager and they come to the Report Manager as a kind of package that the Report Manager places into something akin to a web part.

  • Daniel Bowlin (10/8/2010)


    SQLMeat (10/8/2010)


    Thanks SPCGHST440,

    CSS can be used to configure the report manager toolbar, but not the report contents. Here is an excerpt from that very page:

    Modifying style sheets has no effect on the appearance of published reports that you run on a report server. In Reporting Services, reports do not reference style sheets. Ad hoc reports that are auto-generated by the report server use style information that is stored as an embedded resource in the report server program files. Reports that you create in Report Designer use the fonts, colors, and layout that you specify in the report definition. Styles are created inline with the rest of the layout.

    Which is quite puzzling. If Microsoft took the time to partially support CSS, why not go full monty!? You still need an alternative way to dynamically style the report contents, which is what we're discussing here. Thanks for your input!

    🙂

    Don't quote me on this but I think this makes sense. The Report Manager is a web app that is subject to style sheets. However I believe the reports are rendered before they get to the report manager and they come to the Report Manager as a kind of package that the Report Manager places into something akin to a web part.

    ...couldn't resist...

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • Great article, and discussion posts. I have been using SSRS for years (since it was in Beta) and never thought to do this.

    Awesome.

  • I normally use a 'template' for all my reports,(http://weblogs.sqlteam.com/jhermiz/archive/2007/08/14/60283.aspx)

    so I'm not sure how this really could benefit me?

    The really pain is standardizing tablixes for reusability.

    Naming all those 'textbox1, textbox2 etc, is quite a pain.

  • MaricopaJoe (10/13/2010)


    I normally use a 'template' for all my reports,(http://weblogs.sqlteam.com/jhermiz/archive/2007/08/14/60283.aspx)

    so I'm not sure how this really could benefit me?

    The really pain is standardizing tablixes for reusability.

    Naming all those 'textbox1, textbox2 etc, is quite a pain.

    You could add the dataset to your template once, complete with properties pointing to your dataset values, then never have to worry about it again. (that's exactly how we use it)

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • Hi

    Apologies if this has already been covered (I've checked the postings and can't see it anywhere). Incidently, this is my first posting on this excellent Forum so apologies for any procedure errors!

    I've already setup the Adam Aspin procedure on 'Centralising Reporting Services Stylesheets' to define the report formatting according to the UserID both at runtime and design-time. However, what I'd like to do is to determine the styles when adding a new report item to an existing report. Because I'm not using the Report Wizard to do this, the StyleTemplates.xml file does not have an effect.

    Thanks in advance for any ideas.

  • These posts are great for setting things like colours, fonts etc but is it possible to set options to get the report to scale to fit different screens? (i.e removing the horizontal scroll bar)...

    [font="Times New Roman"]There's no kill switch on awesome![/font]

Viewing 15 posts - 31 through 45 (of 45 total)

You must be logged in to reply to this topic. Login to reply