Store and restore style sheets
Follow steps in this procedure to store and restore report style sheets.
Using the Report Designer, it is possible to store a report's style sheet (containing all the report's styles) in an external REPSS file. This makes it possible to easily restore a report's appearance from this file.
- Create a new report.
- Click the report's Smart tag, and in the actions list, locate the Style Sheet property and click its browse button (...).
- In the Styles Editor, click the Add button to create new styles.
-
Define properties for the new styles and click the Save
button.
- In the Save File dialog box, define a name for the style sheet file (.REPSS) to be created and click Save.
- Back in the Styles Editor dialog box, use the Delete button to delete the created styles, and then click Close.
- Select the report, by clicking anywhere over the blank area around its bands.
- In the Property Grid, locate the Style Sheet Path property and click its browse button (...).
-
In the Open File dialog box, load the created REPSS
file.
If you then click the Style Sheet properties browse button (...) to open the Styles Editor, you'll see that the properties of the styles are read-only. This is because we used the Style Sheet Path property to load the style sheet.
If the Style Sheet Path property is then set to None, and a style sheet is loaded into a report using the Style Sheet property, all the styles loaded from the style sheet file will still be kept in the report, but become editable.
-
Now, assign these styles to the required report controls, by using their
Styles property.
In the figure, we assigned the created styles to the control's Odd Style and Even Style properties. For more information, see Use Odd and Even Styles.Styles loaded from a style sheet file have a higher priority than the styles which exist in a report's style sheet, returned by the Style Sheet property. This means that if the styles stored in the report have the same names as the styles loaded from a style sheet file, then the styles in the file will substitute for their namesakes. And, the styles loaded from a file cannot be edited in a report.
![Style sheets example Style sheets example](Images/RD_HowTo_StyleSheets_4.png)