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.

  1. Create a new report.
  2. Click the report's Smart tag, and in the actions list, locate the Style Sheet property and click its browse button (...).
  3. In the Styles Editor, click the Add button to create new styles.
  4. Define properties for the new styles and click the Save button.
    Styles Editor
  5. In the Save File dialog box, define a name for the style sheet file (.REPSS) to be created and click Save.
  6. Back in the Styles Editor dialog box, use the Delete button to delete the created styles, and then click Close.
  7. Select the report, by clicking anywhere over the blank area around its bands.
  8. In the Property Grid, locate the Style Sheet Path property and click its browse button (...).
  9. 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.

  10. 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.
    Style sheets
    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.
The result of this procedure is shown in the following figure.
Style sheets example