With 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. For more information on using styles in the Report Designer, refer to Understand Styles Concepts.
To store and restore report style sheets, follow the steps below.
- Create a new report.
- Bind the report to a data source.
-
Click the report's Smart Tag, and in the invoked actions list, locate the Style Sheetproperty and click its ellipsis button.
-
In the invoked Styles Editor, use the button, to create new styles. Define their required properties and click the Savebutton.
In the invoked Save Filedialog, define a name for the style sheet file (.REPSS) to be created and click Save.
-
Now, in the Styles Editordialog, use the button to delete the created styles, and close the dialog.
-
Select the report, by clicking anywhere over the blank area around its bands. In the Property Grid, locate the Style Sheet Pathproperty and click its ellipsis button. In the invoked Open Filedialog, load the created REPSS file.
If you then click the Style Sheetproperties ellipsis button, in the invoked Styles Editor, you'll see that the properties of the styles are read-only. This is because we used the Style Sheet Pathproperty to load the style sheet.
If the Style Sheet Pathproperty is then set to None, and a style sheet is loaded into a report using the Style Sheetproperty, 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 Stylesproperty. In this example, we assign the created styles to the control's Odd Styleand Even Styleproperties. To learn more on this, refer to Use Odd and Even Styles.
Note Note that the 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 Sheetproperty. 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 can't be edited in a report. For more information, refer to Understand Styles Concepts.
The result is shown in the following image.