Wednesday, December 3, 2008

SSRS Tip - Create your Own Style Template

While creating a New Report, I was using the Default Table/Matrix Styles built in with SSRS. By default it has 'Slate', 'Forest'... But for some reason, I am not satisfied with the Colors in those Styles. So After creating a Report with those Style, I had to manually change the color,font etc. So I thought of making a Custom Style/Theme with my own choice of Color, Font, Size etc. So I researched and found that we can create our own Style/Theme and add it to the Built in ones.
These are the steps:
1. Goto : C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Business Intelligence Wizards\Reports\Styles\en
2. See the 'StyleTemplates.xml', which contains all the Style definitions in XML format. You will see the styletemplates 'Slate', 'Forest' etc.
3. Add your own StyleTemplate with your styles to the Root tag.
4. Create a New Report, you will see this new StyleTemplate in the 'Report Wizard - Choose the Table Style'.

The modified StyleTemplates.xml can be downloaded here:

In this example I created my own custom StyleTemplate (the following) and added it.



<StyleTemplate Name="LightTheme"> <Label>LightTheme</Label> <Styles> <Style Name="Title"> <FontFamily>Tahoma</FontFamily> <FontWeight>Bold</FontWeight> <FontSize>12pt</FontSize> </Style> <Style Name="Page Group Level 1"> <FontFamily>Tahoma</FontFamily> <FontSize>10pt</FontSize> </Style> <Style Name="Page Group Level 2"> <FontFamily>Tahoma</FontFamily> <FontSize>9pt</FontSize> </Style> <Style Name="Page Group Level 3+"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> </Style> <Style Name="Table"></Style> <Style Name="Matrix"></Style> <Style Name="Table Header"> <BackgroundColor>Gray</BackgroundColor> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <FontWeight>Bold</FontWeight> <Color>White</Color> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>DimGray</Default> </BorderColor> </Style> <Style Name="Group Level 1"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>DarkGray</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>DimGray</Default> </BorderColor> </Style> <Style Name="Group Level 1 Textbox"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>DarkGray</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>DimGray</Default> </BorderColor> </Style> <Style Name="Group Level 2"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>Gainsboro</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>LightGrey</Default> </BorderColor> </Style> <Style Name="Group Level 2 Textbox"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>Gainsboro</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>LightGrey</Default> </BorderColor> </Style> <Style Name="Group Level 3+"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>Gainsboro</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>LightGrey</Default> </BorderColor> </Style> <Style Name="Group Level 3+ Textbox"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>Gainsboro</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>LightGrey</Default> </BorderColor> </Style> <Style Name="Detail"> <FontFamily>Tahoma</FontFamily> <FontSize>8pt</FontSize> <BackgroundColor>Gainsboro</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> <BorderColor> <Default>DimGray</Default> </BorderColor> <TextAlign>Right</TextAlign> </Style> </Styles> </StyleTemplate>

No comments:

Post a Comment