ActiveReports 9 > ActiveReports User Guide > How To > Section Report How To > Use External Style Sheets |
In a section layout, you can set custom style values in the Styles page of the Report Settings Dialog, and then apply the styles to controls using the ClassName property from the Properties Window.
You can also apply these same styles to controls in other reports, by exporting them to a XML file of type *.reportstyle and selecting it in other reports using the Report Settings dialog.
Note: You can apply styles to the CheckBox, Label, TextBox, and ReportInfo controls only. |
To modify or create a style and save it to an external style sheet
To load and apply an external style sheet at design time
To load an external style sheet at runtime and apply it
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
Me.LoadStyles("C:\MyStyleSheet.reportstyle") |
C# code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
this.LoadStyles(@"C:\MyStyleSheet.reportstyle"); |
To apply a style to a control at runtime
The following steps assume that you have already loaded an external style sheet to the report.
Visual Basic.NET code. Paste INSIDE the Format event. |
Copy Code
|
---|---|
Me.TextBox.ClassName = "Heading1" |
C# code. Paste INSIDE the Format event. |
Copy Code
|
---|---|
this.textBox.ClassName = "Heading1"; |